pstest: Performs the power analysis for the projected score test

Description Usage Arguments Value

Description

This is an independent function which calls setup from sim_setup(), which sets up all of the variables needed for one value of kperc, percentage of independent variables with nonzero signal and one value of mbeta, mean coefficient for non zero effects uniform around that value That function loops through the variables k and beta.

Usage

1
2
3
4
pstest(nsim = 500, seed = 2019, mbeta = 0, kperc = 40, n = 100,
  p = 1000, model = "normal", sigma = 1, alpha = 0.05,
  betasp = TRUE, rs = c(10, 20, 50), mc.cores = 1, Gprime, GQs, GQs2,
  R1nams, R2nams, nams, H1, A, G, linkatlambda, simresults, powresults)

Arguments

nsim

number of simulations to run to calculate power

seed

set a seed for the power calculation, defaults to 2019

mbeta

mean coefficient for nonzero effects, defaults to 0

kperc

percentage of independent variables with nonzero signal, defaults to 40

n

defaults to 100

p

defaults to 1000

model

can be specified as 'normal' (default) for linear regression, otherwise does logistic regression

sigma

defaults to 1

alpha

significance level, defaults to 0.05

betasp

indicator of presence of spatial information, defaults to TRUE

rs

investigator-specified set of "contrasts" of G, defaults to c(10, 20, 50)

mc.cores

number of cores to run simulation on

Gprime

parameter from sim_setup(), defaults to NULL

GQs

parameter from sim_setup(), defaults to NULL

GQs2

parameter from sim_setup(), defaults to NULL

R1nams

parameter from sim_setup(), defaults to NULL

R2nams

parameter from sim_setup(), defaults to NULL

nams

parameter from sim_setup(), defaults to NULL

H1

parameter from sim_setup(), defaults to NULL

A

parameter from sim_setup(), defaults to NULL

G

parameter from sim_setup(), defaults to NULL

linkatlambda

parameter from sim_setup(), defaults to NULL

simresults

empty dataframe from sim_setup(), defaults to NULL

powresults

empty dataframe from sim_setup(), defaults to NULL

Value

A list of the entire matrix of simulation results, the power results


carolynlou/pstestr documentation built on June 3, 2019, 6:21 p.m.