GSPCRexdata {gspcr} | R Documentation |
GSPCR example data
Description
Contains a data set used to develop and test the main features of the gspcr
package. The data contains a dependent variable and 50 predictors generated based on true number of principal components.
Format
GSPCRexdata
is a list containing two data.frame objects:
-
X
: A list of data.frames with 1000 rows (observations) and 50 columns (possible predictors). The list contains matrices storing data coded with different measurement levels:-
cont
with 50 continuous variables -
bin
with 50 binary variables (factors) -
ord
with 50 ordinal variables (ordered factors) -
cat
with 50 categorical variables (unordered factors) -
mix
with 20 continuous variables, 10 binary variables (factors), 10 ordinal variables (ordered factors), 10 categorical variables (unordered factors).
-
-
y
: A data.frame with 1000 rows and 5 columns. The first columncont
is a continuous variable produced using a linear model with the first two PCs underlyingX
as a data-generating model. The other columns are transformed versions ofcont
to match common discrete target distribution in the social sciences. These are the variables stored:-
cont
continuous dependent variable (numeric vector) -
bin
binary dependent variable (factor) -
ord
ordinal dependent variable (ordered factor) -
cat
nominal dependent variable (unordered factor) -
pois
count dependent variable (numeric vector)
-
Examples
# Check out the first 6 rows of the continuous predictors
head(GSPCRexdata$X$cont)
# Check out first 6 rows of the dv data.frame
head(GSPCRexdata$y)