sim.my: Simulate data

Description Usage Arguments Details Value Examples

Description

Simulate data

Usage

1
sim.my(n, seed, label, alpha, beta, e. = NULL, b. = NULL, tr. = NULL)

Arguments

n

Sample size

seed

Seed for random number generator

label

A character string which specifies the simulation scenario. sigmoid4, sigmoidgam4, elbow4

alpha

regression parameter

beta

regression parameter

e.

inflection point for the logistic transformation (the log scale)

b.

slope for the logistic transformation

tr.

threshold point

Details

When the label starts with elbow, the transformation on x.star is elbow shaped. When the label starts with sigmoid, the transformation on x.star is sigmoid shaped. Data simulated from logit(Pr(Y==1))=alpha + beta*(transformed x.star).

Value

A data frame with columns: y, x.star, x.star.expit (if label starts with sigmoid), x.star.tr (if label starts with elbow), x.bin.med (x.star dichotomized at median), x.tri (x.star trichotomized at tertiles).

Examples

1
2
3
alpha=-1; beta=log(0.2)
e.=5; b.=-30; t.=1
dat=sim.my(n=250, seed=1, label="sigmoid4", alpha, beta, e.=e., b.=b.)


Search within the chngpt package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.