fit_model: Fit OLS model for a single outcome

Description Usage Arguments Examples

View source: R/NRejections.R

Description

The user does not need to call this function. Fits OLS model for a single outcome with or without centering the test statistics to enforce the global null.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
fit_model(
  X,
  C = NA,
  Y,
  Ys,
  d,
  center.stats = FALSE,
  bhat.orig = NA,
  alpha = 0.05
)

Arguments

X

Single quoted name of covariate of interest

C

Vector of quoted covariate names

Y

Quoted name of single outcome for which model should be fit

Ys

Vector of all quoted outcome names

d

Dataframe

center.stats

Should test statistics be centered by original-sample estimates to enforce global null?

bhat.orig

Estimated coefficients for covariate of interest in original sample (W-vector). Can be left NA for non-centered stats.

alpha

Alpha level for individual tests

Examples

1
2
3
4
5
6
7
8
9
data(attitude)
fit_model( X = "complaints",
           C = c("privileges", "learning"),
           Y = "rating",
           Ys = c("rating", "raises"),
           d = attitude,
           center.stats = FALSE,
           bhat.orig = NA,  
           alpha = 0.05 )

NRejections documentation built on July 9, 2020, 5:08 p.m.