wp.mc.chisq.diff: Statistical Power Analysis for SEM Based on Chi-square...

View source: R/webpower.R

wp.mc.chisq.diffR Documentation

Statistical Power Analysis for SEM Based on Chi-square Difference Test

Description

This function is for SEM power analysis based on the chi-square difference test.

Usage

wp.mc.chisq.diff(full.model.pop, full.model, 
reduced.model, N=100, R=1000, alpha=0.05)

Arguments

full.model.pop

Full model (under the alternative hypothesis) with population parameters.

full.model

Full model (under the alternative hypothesis) lavaan specification.

reduced.model

Reduced model (under the null hypothesis) lavaan specification.

N

Sample size.

R

Number of Monte Carlo replications.

alpha

significance level chosed for the test. It equals 0.05 by default.

Value

An object of the power analysis.

power

Statistical power.

df

Degrees of freedom

chi.diff

Chi-square differences between the reduced model and the full model

References

Demidenko, E. (2007). Sample size determination for logistic regression revisited. Statistics in medicine, 26(18), 3385-3397.

Zhang, Z., & Yuan, K.-H. (2018). Practical Statistical Power Analysis Using Webpower and R (Eds). Granger, IN: ISDSA Press.

Examples


set.seed(20220722)

full.model.pop <-'
y1 ~ 0.4*x
y2 ~ 0.5*x + 0.2*y1
y3 ~ 0.4*x
y4 ~ 0.4*y1 + 0.4*y2 + 0.4*y3
y1 ~~ 0.84*y1
y2 ~~ 0.61*y2
y3 ~~ 0.84*y3
y4 ~~ 0.27*y4
'

full.model <-'
y1 ~ x
y2 ~ x + y1
y3 ~ x
y4 ~ y1 + y2 + y3
'

reduced.model <-'
y1 ~ x
y2 ~ x 
y3 ~ x
y4 ~ y1 + y3
'

wp.mc.chisq.diff(full.model.pop, full.model, reduced.model)



WebPower documentation built on Oct. 14, 2023, 1:06 a.m.