Learn R Programming

MBESS (version 4.9.3)

ss.aipe.c.ancova.sensitivity: Sensitivity analysis for sample size planning for the (unstandardized) contrast in randomized ANCOVA from the Accuracy in Parameter Estimation (AIPE) Perspective

Description

Performs a sensitivity analysis when planning sample size from the Accuracy in Parameter Estimation (AIPE) Perspective for the (unstandardized) contrast in randomized ANCOVA design.

Usage

ss.aipe.c.ancova.sensitivity(true.error.var.ancova = NULL, 
est.error.var.ancova = NULL, true.error.var.anova = NULL, 
est.error.var.anova = NULL, rho, est.rho = NULL, G = 10000, 
mu.y, sigma.y, mu.x, sigma.x, c.weights, width,
conf.level = 0.95, assurance = NULL, certainty=NULL)

Value

Psi.obs

the observed (unstandardized) contrast

se.Psi

the standard error of the observed (unstandardized) contrast

se.Psi.restricted

the standard error of the observed (unstandardized) contrast calculated by ignoring the covariate

se.res.over.se.full

the ratio of contrast's full standard error over the restricted one in each iteration

width.obs

full confidence interval width

Type.I.Error

Type I error happens in each iteration

Type.I.Error.Upper

Type I error happens in the upper end in each iteration

Type.I.Error.Lower

Type I error happens in the lower end in each iteration

Type.I.Error

percentage of Type I error happened in the entire simulation

Type.I.Error.Upper

percentage of Type I error happened in the upper end in the entire simulation

Type.I.Error.Lower

percentage of Type I error happened in the lower end in the entire simulation

width.NARROWER.than.desired

percentage of obtained widths that are narrower than the desired width

Mean.width.obs

mean width of the obtained full confidence intervals

Median.width.obs

median width of the obtained full confidence intervals

Mean.se.res.vs.se.full

the mean of the ratios of contrast's full standard error over the restricted one

Psi.pop

population (unstandardized) contrast

Contrast.Weights

contrast weights

mu.y

the response's population mean of each group

mu.x

the population mean of the covariate

sigma.x

the population standard deviation of the covariate

Sample.Size.per.Group

sample size per group

conf.level

the desired confidence interval coverage, (i.e., 1 - Type I error rate)

assurance

specified assurance

rho

population correlation coefficient of the response and the covariate

est.rho

estimated correlation coefficient of the response and the covariate

true.error.var.ANOVA

population error variance of the ANOVA model

est.error.var.ANOVA

estimated error variance of the ANOVA model

Arguments

true.error.var.ancova

population error variance of the ANCOVA model

est.error.var.ancova

estimated error variance of the ANCOVA model

true.error.var.anova

population error variance of the ANOVA model (i.e., excluding the covariate)

est.error.var.anova

estimated error variance of the ANOVA model (i.e., excluding the covariate)

rho

population correlation coefficient of the response and the covariate

est.rho

estimated correlation coefficient of the response and the covariate

G

number of generations (i.e., replications) of the simulation

mu.y

vector that contains the response's population mean of each group

sigma.y

the population standard deviation of the response

mu.x

the population mean of the covariate

sigma.x

the population standard deviation of the covariate

c.weights

the contrast weights

width

the desired full width of the obtained confidence interval

conf.level

the desired confidence interval coverage, (i.e., 1 - Type I error rate)

assurance

parameter to ensure that the obtained confidence interval width is narrower than the desired width with a specified degree of certainty (must be NULL or between zero and unity)

certainty

an alias for assurance

Author

Keke Lai (University of Notre Dame; Lai.15@ND.Edu)

Details

The arguments mu.y, mu.x, sigma.y, and sigma.x are used to generate random data in the simulations for the sensitivity analysis. The value of mu.y should be the same as the square root of true.error.var.anova

So far this function is based on one-covariate randomized ANCOVA design only. The argument mu.x should be a single number, because it is assumed that the population mean of the covariate is equal across groups in randomized ANCOVA.

Examples

Run this code
if (FALSE) {
ss.aipe.c.ancova.sensitivity(true.error.var.ancova=30, 
est.error.var.ancova=30, rho=.2, mu.y=c(10,12,15,13), mu.x=2, 
G=1000, sigma.x=1.3, sigma.y=2, c.weights=c(1,0,-1,0), width=3)

ss.aipe.c.ancova.sensitivity(true.error.var.anova=36, 
est.error.var.anova=36, rho=.2, est.rho=.2, G=1000, 
mu.y=c(10,12,15,13), mu.x=2, sigma.x=1.3, sigma.y=6, 
c.weights=c(1,0,-1,0), width=3, assurance=NULL)
}

Run the code above in your browser using DataLab