---
title: "NeutroSurvey"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{VMDML}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```
**Introduction to neutrosophic interval analysis including metric calculations and MSE estimation for survey data**

## Authors

Neha Purwar

Kaustav Aditya(https://orcid.org/0000-0003-2457-9494)

Pankaj Das (https://orcid.org/0000-0003-1672-2502)

Bharti

## Introduction

The R package is designed for neutrosophic regression type estimator to estimate the Finite Population Parameters. This package provides three different function i.e. compute_all_metrics, inputs and calculate_all_mse_neutrosophic. It provide neutrosophic descriptive statistics. Users can  input values for population size as well as sample size for neutrosophic population at run time . In this package we can obtain the mse value for neutrosophic ratio-type estimators, neutrosophic exponential ratio-type estimator and neutrosophic regression type estimator.

## Functions in the R package

This package provides specialized tools for analyzing interval-valued data within a neutrosophic statistical framework.
Here's a detailed explanation of each function's utility:

**1. compute_all_metrics()**

Utility: This is the foundational function that calculates all essential statistics for neutrosophic interval data.

Key Features:

a. Calculates mean intervals for both auxiliary and study variables

b. Computes standard deviations for interval bounds

c. Determines coefficients of variation (CV) for both variables

d. Calculates kurtosis values to understand distribution shapes

e. Estimates correlations between interval variables

**Use Cases:**

Initial exploratory analysis of interval data

Preparing inputs for more advanced calculations

Understanding data variability and relationships between interval variables

**2. calculate_all_mse_neutrosophic()**

Utility: Computes five different types of Mean Squared Error (MSE) estimates specifically designed for neutrosophic interval data.

a. MSE Types Calculated:

b. Standard MSE: Basic interval MSE estimation

c. Ratio-adjusted MSE: Incorporates ratio estimation techniques

Kurtosis-adjusted MSE: Accounts for distribution shape through kurtosis

d. Exponential MSE: Uses exponential weighting factors

e. Regression MSE: Leverages correlation between variables

**Use Cases:**

i. Comparing different estimation methods for interval data

ii. Robust error estimation in neutrosophic statistics

iii. Model selection and evaluation


**3. get_user_inputs()**

Utility: Provides an interactive way to collect population and sample size parameters.

**Key Features:**

a. Guides users through parameter input process

b. Automatically calculates theta values (1/n - 1/N)

c. Validates input values to ensure n < N

**Use Cases:**

i. Interactive data analysis workflows

ii. Educational demonstrations

iii. Quick parameter estimation

**4. format_mse_results()**

Utility: Transforms raw MSE results into human-readable formatted output.

**Key Features:**

a. Clearly labels each MSE type

b. Formats numbers for consistent display

c. Returns ready-to-print output

**Use Cases:**

i. Reporting results in publications

ii. Creating readable output for presentations

iv. Quick visual comparison of MSE types

v. Data Management

**5.calculate_pre()**
The `calculate_pre()` function computes the Percentage Relative Efficiency of different estimators compared to the regression estimator:

**Interpretation:**

a. Values > 100 indicate better efficiency than regression

b. Values < 100 indicate worse efficiency than regression

c. The regression estimator (PRE_r) is always 100 by definition

**6. japan_neutro Dataset** 

Utility: Example dataset demonstrating proper input format and typical values.

**Key Features:**

a. Real-world interval data structure

b. Properly formatted columns

c. Demonstrates expected value ranges

**Use Cases:**

i. Package testing and validation

ii. Learning proper data formatting

iv. Benchmarking analyses


## Technical Implementation Benefits

**Consistent Interface:** All functions follow R conventions for parameter naming and return structures

**Error Handling:** Comprehensive input validation prevents common mistakes

**Reproducibility:** Deterministic calculations ensure consistent results

**Performance:** Optimized for medium-sized datasets (hundreds to thousands of observations)

**Integration:** Works seamlessly with standard R data structures and pipelines

## Practical Applications of the package

This package is particularly valuable for:

a. Researchers working with imprecise measurements or range-based data

b. Statisticians developing new neutrosophic methods

c. Data Scientists analyzing interval-censored data

d. Quality Control applications with tolerance intervals

e. Environmental Studies with measurement ranges

f. Economic Forecasting dealing with prediction intervals

The combination of these functions provides a complete workflow from data input through comprehensive analysis to formatted result reporting, all within the specialized domain of neutrosophic interval statistics.

```{r setup}
##Example how the package works
library(neutroSurvey)

#data importation
data(japan_neutro)

#computation of metrics
metrics <- compute_all_metrics(japan_neutro)
mse <- calculate_all_mse_neutrosophic(
  0.01, 0.02,
  metrics$mean_interval_Y[1], metrics$mean_interval_Y[2],
  metrics$mean_interval_X[1], metrics$mean_interval_X[2],
  metrics$cv_interval_X[1], metrics$cv_interval_X[2],
  metrics$cv_interval_Y[1], metrics$cv_interval_Y[2],
  metrics$correlation_results[1], metrics$correlation_results[2],
  metrics$kurtosis_interval_X[1], metrics$kurtosis_interval_X[2]
)

cat(format_mse_results(mse))
