Learn R Programming

RRI (version 1.1)

example_model: Example regression model and H0.

Description

Example regression model and H0.

Usage

example_model(n = 100)

Arguments

n

Number of datapoints.

Value

List of (y, X, lam, lam0) that corresponds to regression model and null hypothesis:

  • y = n-length vector of outcomes

  • X = n x p covariate matrix;

  • lam = p-vector of coefficients

  • lam0 = real number.

The null we are testing through this specification is

H0: lam' beta = lam[1] * beta[1] + ... + lam[p] * beta[p] = lam0,

where beta are the model parameters in the regression, y = X beta + e. By default this example sets p = 2-dim model, lam = (0, 1) and lam0 = 0. In this specification, H0: beta[2] = 0.

Examples

Run this code
# NOT RUN {
model = example_model()
lm(model$y ~ model$X + 0)
# }

Run the code above in your browser using DataLab