compute_sample_size: Sample size for Generalized Linear Models

Description Usage Arguments Examples

Description

Calculate sample size required to meet minimial detectable effect given standard deviation of the predictor, multiple correlation, power, false positive rate, and variance of the outcome.

Usage

1
2
compute_sample_size(method_name, beta, sigma_x, mult_cor, power = 0.8,
  fpr = 0.05, ...)

Arguments

method_name

Name of GLM intended to be used. Function accepts: 'linear regression', 'logistic regression', 'cox regression', or 'poisson regression'

beta

Smallest effect to detect

sigma_x

Standard deviation of the predictor to which beta applies

mult_cor

Multiple correlation with other covariates

power

Desired statistical power, must be between 0 and 1 (default 0.8)

fpr

False positive rate, must bebetween 0 and 1 (Default 0.05)

...

arguments to variance function

Examples

1
2
3
4
samplesize(method_name='linear regression', 1,1,0,var_y=1)
samplesize(method_name='logistic regression', 1,1,0,p=0.5)
samplesize(method_name='cox regression', 1,1,0,prob_uncens=0.75)
samplesize(method_name='poisson regression', 1,1,0,disp=1)

Dpananos/poweregg documentation built on May 17, 2019, 5:25 a.m.