Description Usage Arguments Value Author(s) References Examples
View source: R/create.dummies.R
This function receives a data set and the name of variables to be transformed into dummies. Then it create the dummy variables, transform it into numeric (to work with PA generation) and remove the master variables that originates the dummies.
1 | create.dummies(data.to.work, dummy.vars)
|
data.to.work |
is a data set containing the variables to tranform. |
dummy.vars |
are the variables to be transformed. |
the new data set
Elias Carvalho
Yves Rosseel (2012). lavaan: An R Package for Structural Equation Modeling. Journal of Statistical Software, 48(2),1-36.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Clean environment
closeAllConnections()
rm(list=ls())
# Set enviroment
# setwd("to your working directory")
# Load packages
library(bnpa)
# Use working data sets from package
data(dataQualiN)
# Show the structure before
str(dataQualiN)
# Set possible dummy variables
dummy.vars <- c("A", "B")
# Create dummies
dataQualiN <- bnpa::create.dummies(dataQualiN, dummy.vars)
# Show the structure before
str(dataQualiN)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.