powered by
Creates dummy variables.
dummy(x,subset=rep(T,length(x)), reference=sort(unique(x[!is.na(x)])),includeAll=F, version=F)
variable used to create the dummy variables.
a subset of the data, if desired.
the reference value for the dummy variables to compare to.
logical value indicating whether all of the dummy variables should be returned (including the reference).
if TRUE, returns the version of the function and nothing else.
TRUE
A matrix containing the dummy variables.
# NOT RUN { # Reading in a dataset mri <- read.table("http://www.emersonstatistics.com/datasets/mri.txt", header=TRUE) attach(mri) # Create a dummy variable for race dummy(race) # }
Run the code above in your browser using DataLab