Using detectnorm in meta-analysis

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width  =  6,
  fig.height =  6,
  fig.align = "center"
)

Introduction

The goal of detectnorm is to speculate the skewness and kurtosis based on the Beta and truncated normal distribution. When conducting a meta-analysis for two independent groups, we generally retrieved very limited statistics from primary studies, and it is hard to access the raw data. However, the non-normality of raw data could influence the meta-analytic results greatly (Sun & Cheung, 2020). This package allows meta-analysis researchers to speculate the skewness and kurtosis of the raw data, even without the raw data. Instead of normal distribution, if the researcher believes the population distribution is non-normal, then beta-distribution could be a good choice. If the researcher believes the population distribution is normal but truncated by the measuring ability of the instrument, then truncated normal distribution is a good option. The package provides not only the skewness and kurtosis estimates but also the figures to visualize them. Now, this package could work directly with the standardized mean difference for two independent groups. It also works for one group of data.

library(detectnorm)

Example

This is a basic example which shows you how to solve a common problem:

For one study if you assumed non-normal distribution in population:

library(detectnorm)
# Situations using beta distributions
set.seed(32411)
#Using Fleishman's method to generate non-normal data
dat1 <- rnonnorm(n = 1000, mean = 0, sd = 1, skew = 2, kurt = 5)$dat
hist(dat1)
psych::describe(dat1)
#Suppose we don't know about the raw data
result <- desbeta(vmean = mean(dat1), vsd = sd(dat1),lo = min(dat1), hi = max(dat1), showFigure = TRUE, rawdata = dat1)
result

For one study if you assumed normal distribution in population with truncated by the measurements:

library(detectnorm)
#Truncated normal distribution
set.seed(34120)
dat2 <- truncnorm::rtruncnorm(n = 1000, a = 0, b = 14, mean = 4, sd = 3)
psych::describe(dat2)
destrunc(vmean=mean(dat2), vsd=sd(dat2), lo=0, hi=14, rawdata = dat2, showFigure = TRUE)

For one meta-analysis of two independent groups. It is very similar to the requirements for package metafor only you need to add one or two columns for each group about the possible minimum and maximum of the data. It will add information including:

In this example, it has contained the empirical skewness skew1 and skew2, which are calculated from raw data.

library(detectnorm)
# examine the meta-analysis dataset by simulating extremely non-normal distribution
# population mean1 = 1, mean2 = 1.5, sd1 = sd2=1, skewness1 = 4, kurtosis2 = 2, skewness2=-4, kurtosis2=2
data("beta_mdat")
beta1 <- 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(beta1)
#compare the sample skewness and estimated skewness using beta distribution
mean(beta1$skew1)#sample skewness calculated from the sample in group 1
mean(beta1$g1_skewness) #estimated using beta in group 1
mean(beta1$skew2) #sample skewness calculated from the sample in group 2
mean(beta1$g2_skewness)#estimated using beta in group 2
library(detectnorm)
data("trun_mdat")
head(trun_mdat)
trun1 <- 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)
mean(trun1$skew1)#sample skewness calculated from the sample in group 1
mean(trun1$g1_skewness)#estimated using truncnorm in group 1
mean(trun1$skew2)#sample skewness calculated from the sample in group 2
mean(trun1$g2_skewness)#estimated using truncnorm in group 2


Try the detectnorm package in your browser

Any scripts or data that you put into this service are public.

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