Package 'fpc' - open source solution for an Internet free, intelligent ...
Package 'fpc' - open source solution for an Internet free, intelligent ...
Package 'fpc' - open source solution for an Internet free, intelligent ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
16 cat2bin<br />
See Also<br />
fixreg<br />
Examples<br />
c<strong>an</strong>(429,3)<br />
cat2bin<br />
Recode nominal variables to binary variables<br />
Description<br />
Usage<br />
Recodes a dataset with nominal variables so that the nominal variables are replaced by binary variables<br />
<strong>for</strong> the categories.<br />
Arguments<br />
cat2bin(x,categorical=NULL)<br />
x<br />
categorical<br />
data matrix or data frame. The data need to be org<strong>an</strong>ised case-wise, i.e., if<br />
there are categorical variables only, <strong>an</strong>d 15 cases with values c(1,1,2) on the 3<br />
variables, the data matrix needs 15 rows with values 1 1 2. (Categorical variables<br />
could take numbers or strings or <strong>an</strong>ything that c<strong>an</strong> be coerced to factor levels as<br />
values.)<br />
vector of numbers of variables to be recoded.<br />
Value<br />
A list with components<br />
data<br />
variableinfo<br />
data matrix with variables specified in categorical replaced by 0-1 variables,<br />
one <strong>for</strong> each category.<br />
list of lists. One list <strong>for</strong> every variable in the original dataset, with four components<br />
each, namely type ("categorical" or "not recoded"), levels (levels<br />
of nominal recoded variables in order of binary variable in output dataset), ncat<br />
(number of categories <strong>for</strong> recoded variables), varnum (number of variables in<br />
output dataset belonging to this original variable).<br />
Author(s)<br />
Christi<strong>an</strong> Hennig http://www.homepages.ucl.ac.uk/~ucakche<br />
See Also<br />
discrete.recode