detectnorm: Calculate skewness and kurtosis based on Beta or truncated...

View source: R/detectnorm.R

detectnormR Documentation

Calculate skewness and kurtosis based on Beta or truncated normal distribution in a meta-analysis for SMD (Two independent groups)

Description

This function can be used to calculate the skewness and kurtosis based on the Beta distribution with the dataset used to conduct meta-analysis.

Usage

detectnorm(
  m1i,
  sd1i,
  n1i,
  lo1i,
  hi1i,
  m2i,
  sd2i,
  n2i,
  lo2i,
  hi2i,
  data,
  showFigure = FALSE,
  distri = "beta",
  ...
)

Arguments

m1i

vector to the means of first group

sd1i

vector to specifiy the standard deviation of first group

n1i

vector to specify the sample size of first group

lo1i

vector to specify the possible minimum of the first group

hi1i

vector to specify the possible maximum of the first group

m2i

vector to the means of second group

sd2i

vector to specifiy the standard deviation of second group

n2i

vector to specify the sample size of second group

lo2i

vector to specify the possible minimum of the second group

hi2i

vector to specify the possible maximum of the second group

data

the opitional original data frame containing the data for the function

showFigure

when showFigure = TRUE, it will display all the plots (within the result as a list, result$fig) with theoretical normal curve and the truncated normal curve.

distri

Beta distribution is used when using 'distri = "beta"'; Truncated normal distribution is used when using 'distri = "truncnorm"'

...

other arguments

Value

The output of the data frame adding some columns of the possible skewness and kurtosis for each groups.

References

\insertRef

barr1999meandetectnorm

\insertRef

johnson1995continuousdetectnorm

\insertRef

robert1995simulationdetectnorm

\insertRef

shah1966estimationdetectnorm

\insertRef

smithson2006betterdetectnorm

\insertRef

sun2020influencedetectnorm

Examples

#truncated normal data
data("trun_mdat")
ex <- detectnorm(m1i = m1,sd1i = sd1,n1i = n1,
hi1i = 4,lo1i = 0,m2i = m2,sd2i = sd2,n2i = n2,
hi2i = 4,lo2i=0,distri = "truncnorm", data = trun_mdat)
head(ex)
#extremely non-normal data
data("beta_mdat")
ex2 <- detectnorm(m1i = m1,sd1i = sd1,n1i = n1,
hi1i = hi1,lo1i = lo1,m2i = m2,sd2i = sd2,n2i = n2,
hi2i = hi2,lo2i=lo2,distri = "beta", data = beta_mdat)
head(ex2)
mean(ex2$skew1)#sample skewness calculated from the sample
mean(ex2$g1_skewness) #estimated using beta

detectnorm documentation built on July 16, 2022, 5:05 p.m.