Learn R Programming

rPowerSampleSize (version 1.0.2)

df.compute: Computation of degrees of freedom.

Description

This function computes the degrees of freedom.

Usage

df.compute(nE, nC, SigmaE = NULL, SigmaC = NULL, matrix.type = NULL,
equalSigmas = NULL, m = NULL)

Arguments

nE

Sample size for the experimental (test) group.

nC

Sample size for the control group.

SigmaE

NULL or a matrix indicating the covariances between the primary endpoints in the experimental (test) group. See Details.

SigmaC

NULL or a matrix indicating the covariances between the primary endpoints in the control group. See Details.

matrix.type

NULL or an integer among 1, 2, 3, 4, giving the type of the matrices 'SigmaE' and 'SigmaC'. See Details.

equalSigmas

NULL or a logical indicating if 'SigmaC' and 'SigmaE' are equal. See Details.

m

NULL or the value for m. See Details.

Value

df

The degrees of freedom.

Details

You should provide either both SigmaE, SigmaC or both matrix.type, equalSigmas. When you provide the former, the latter should be set to NULL. And vice versa.

References

Delorme P., Lafaye de Micheaux P., Liquet B., Riou, J. (2015). Type-II Generalized Family-Wise Error Rate Formulas with Application to Sample Size Determination. Statistics in Medicine. Romano J. and Shaikh A. (2006) Stepup Procedures For Control of Generalizations of the Familywise Error Rate. The Annals of Statistics, 34(4), 1850--1873.

See Also

global.1m.analysis, indiv.1m.ssc, indiv.1m.analysis, global.1m.ssc

Examples

Run this code
# NOT RUN {
# standard deviation of the treatment effect
var <- c(0.3520^2,0.6219^2,0.5427^2,0.6075^2,0.6277^2,0.5527^2,0.8066^2)

# Correlation matrix 
cov <- matrix(1,ncol=7,nrow=7)
cov[1,2:7] <- cov[2:7,1] <- c(0.1341692,0.1373891,0.07480123,0.1401267,0.1280336,0.1614103)
cov[2,3:7] <- cov[3:7,2] <- c(0.2874531,0.18451960,0.3156895,0.2954996,0.3963837)
cov[3,4:7] <- cov[4:7,3] <- c(0.19903400,0.2736123,0.2369907,0.3423579)
cov[4,5:7] <- cov[5:7,4] <- c(0.1915028,0.1558958,0.2376056)
cov[5,6:7] <- cov[6:7,5] <- c(0.2642217,0.3969920)
cov[6,7] <- cov[7,6] <- c(0.3352029)

# Covariance matrix
diag(cov) <- var

df.compute(SigmaE = cov, SigmaC = cov, nE = 20, nC = 30)

# }

Run the code above in your browser using DataLab