Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

SimData

Simulate dataset


Description

Simulate predictor, covariate, and continuous outcome data

Usage

SimData(n = 100, M = 5, sigsq.true = 0.5, beta.true = 2, hfun = 3,
  Zgen = "norm", ind = 1:2, family = "gaussian")

Arguments

n

Number of observations

M

Number of predictor variables to generate

sigsq.true

Variance of normally distributed residual error

beta.true

Coefficient on the covariate

hfun

An integer from 1 to 3 identifying which predictor-response function to generate

Zgen

Method for generating the matrix Z of exposure variables, taking one of the values c("unif", "norm", "corr", "realistic")

ind

select which predictor(s) will be included in the h function; how many predictors that can be included will depend on which h function is being used.

family

a description of the error distribution and link function to be used in the model. Currently implemented for gaussian and binomial families.

Details

  • hfun = 1: A nonlinear function of the first predictor

  • hfun = 2: A linear function of the first two predictors and their product term

  • hfun = 3: A nonlinear and nonadditive function of the first two predictor variables

Examples

set.seed(5)
dat <- SimData()

bkmr

Bayesian Kernel Machine Regression

v0.2.0
GPL-2
Authors
Jennifer F. Bobb [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.