analyticVar: Analytic calculation of the standard error of the variance

View source: R/analyticVar.R

analyticVarR Documentation

Analytic calculation of the standard error of the variance

Description

This model-free method to calculate analytically the standard error of the variance. It's based on the use of the appropriate h-statistic as an estimator, as default. It is offers a corrected version of the method described in Wonnapinij et al.. If instead the Wonnapinij et al. method shall be used, use method="Wonnapinij".

Usage

analyticVar(data, normal = FALSE, method = "hstatistic")

Arguments

data

The input data in the form of a vector. NA values are omitted.

normal

Parameter that indicates if the normal approximation should be used instead of the general formula from (Wilks, S. S. (1962).Mathematical Statistics). Default is FALSE.

method

What method to use for the estimation of the standard error of the variance. Accepted values are "hstatistic" (default) and "Wonnapinij".

Value

The analytically derived standard error of the variance of data.

Examples

# size of the sample
n=50
#generate a random sample of size n from a normal distribution
data_ex=rnorm(n,0.5,0.1)
analyticVar(data)

mouseData=readHeteroplasmyData("HB")
mouseData1 = mouseData[which(!is.na(mouseData[,1])),1]
analyticVar(mouseData1,method="hstatistic")

# use the package data and load it to variable mouseData
mouseData=mousedataLE
# calculate the standard error of the variance for the LE oocyte sample #3
bootstrapVar(mouseData[,3])

kostasgian21/heteroplasmy documentation built on Jan. 30, 2024, 12:30 a.m.