fngendata {GCEstim} | R Documentation |
Data generating function
Description
Generates data
Usage
fngendata(
n,
bin.k = 0,
bin.prob = NULL,
cont.k = 5,
y.gen.bin.k = 0,
y.gen.bin.beta = NULL,
y.gen.bin.prob = NULL,
y.gen.cont.beta = c(2, 4, 6, 8, 10),
y.gen.cont.mod.k = 0,
y.gen.cont.mod.beta = matrix(c(-2, 2), 1, 2, byrow = TRUE),
y.gen.bin.mod.prob = c(0.5),
y.gen.cont.sp.k = 0,
y.gen.cont.sp.groups = 2,
y.gen.cont.sp.rho = 0.2,
y.gen.cont.sp.dif = 1,
intercept.beta = 0,
Xgenerator.method = "simstudy",
corMatrix = 100,
rho = NULL,
corstr = NULL,
condnumber = 1,
mu = 0,
muvect = NULL,
sd = 1,
sdvect = NULL,
error.dist = "normal",
error.dist.mean = 0,
error.dist.sd = 1,
error.dist.snr = NULL,
error.dist.df = 2,
dataframe = TRUE,
seed = NULL
)
Arguments
n |
Number of individuals. |
bin.k |
Number of binary variables not used for generating y. |
bin.prob |
A vector of probabilities with length equal to |
cont.k |
Number of continuous variables not used for generating y. |
y.gen.bin.k |
Number of binary variables used for generating y. |
y.gen.bin.beta |
A vector of coefficients with length equal to |
y.gen.bin.prob |
A vector of probabilities with length equal
to |
y.gen.cont.beta |
A vector of coefficients with length equal to |
y.gen.cont.mod.k |
Experimental |
y.gen.cont.mod.beta |
Experimental |
y.gen.bin.mod.prob |
Experimental |
y.gen.cont.sp.k |
Experimental |
y.gen.cont.sp.groups |
Experimental |
y.gen.cont.sp.rho |
Experimental |
y.gen.cont.sp.dif |
Experimental |
intercept.beta |
Value for the constant used to generate y. |
Xgenerator.method |
Method used to generate X data ( |
corMatrix |
A positive number for alphad
(see |
rho |
Correlation coefficient, |
corstr |
correlation structure ( |
condnumber |
A value for the condition number of the X matrix to be used
when |
mu |
The mean of the variables. To be used when all variables have the same mean. |
muvect |
A vector of means. To be used when variables have different means.
The length of |
sd |
Standard deviation of the variables. To be used when all variables have the same standard deviation. |
sdvect |
A vector of standard deviations. To be used when variables have
different standard deviations. The length of |
error.dist |
Distribution of the error. |
error.dist.mean |
Mean value used when |
error.dist.sd |
Standard deviation value used when |
error.dist.snr |
Signal to noise ratio. If not |
error.dist.df |
Degrees of freedom used when |
dataframe |
Logical. If |
seed |
A seed for reproducibility. |
Value
A data.frame
or a list
composed of a matrix of
independent variables values (X), a vector of the dependent variable values
(y), a vector of coefficient values (coefficients), a vector of non-zero
coefficients (y.coefficients), and a vector of the error values (epsilon).
Author(s)
Jorge Cabral, jorgecabral@ua.pt
Examples
dataGCEstim <- fngendata(
n = 100, cont.k = 2,
y.gen.cont.beta = c(3, 6, 9),
intercept.beta = 1,
Xgenerator.method = "svd", condnumber = 50,
mu = 0, sd = 1,
error.dist = "normal", error.dist.mean = 0, error.dist.snr = 5,
dataframe = TRUE, seed = 230676)
summary(dataGCEstim)