sim.my | R Documentation |
Simulate data
sim.my(n, seed, label, alpha, beta, e. = NULL, b. = NULL, tr. = NULL)
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 |
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).
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).
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.)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.