logiSS: Sample size for given coefficient and events per covariate...

Description Usage Arguments Value Examples

View source: R/logiSS.R

Description

Gives sample size necessary to demonstrate that coefficient in model for given predictor is equal to its given value (rather than equal to zero) for a given level of power and significance.

Also number of events (smaller of outcome y=0 and outcome y=1) per predictor.

Uses different methods depending on whether model has one binomial, one continuous or multiple predictors.

Usage

1
  logiSS(x, alpha = 0.05, beta = 0.8, coeff = "x1")

Arguments

x

A logistic regression model of class glm

alpha

significance level α for null-hypothesis significance test

beta

power β for null-hypothesis significance test

coeff

Name of predictor (coefficient) in model to be tested

Value

A list of:

res

Result: Sample size required to show coefficient for predictor is as given in the model rather than 0

epc

Events per covariate; should be >10 to make meaningful statements about coefficients obtained

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
set.seed(1)
### one coefficient, which is binomial
f1 <- genLogiDf(b=1, c=0, n=50)$model
logiSS(f1)
###
### one coefficient, which is continuous
f1 <- genLogiDf(f=0, b=0, c=1, n=50)$model
logiSS(f1, coeff="x1")
###
### binomial coefficient
f1 <- genLogiDf(f=0, b=1, c=1, n=50)$model
logiSS(f1, coeff="x1")
###
### continuous coefficient
f1 <- genLogiDf(f=0, b=1, c=1, n=50)$model
logiSS(f1, coeff="x2")

logisticDx documentation built on May 2, 2019, 6:30 p.m.