You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recodingisabasicstepinanyanalysis.It's fairly easy to recode a single variable (e.g. by replacing values in the vector or using the \code{recode} function in \bold{car} or \code{mapvalues} in \bold{plyr}), but it can be cumbersome to recode multiple variables into a single vector .This is useful when, for example, a factorial experiment has the group for each factor stored as separate variables, but analysis will be performed across the entire design (rather than factor-by-factor), or when it is necessary to create a factor representing multivariate combinations of demographic groups (e.g., an age-sex-race stratification) from a set of separate input vectors representing each demographic variable. That would normally require a series of \code{\link[base]{ifelse}} statements or complex use of boolean arguments. This function aims to make it simple to create a single vector from multiple input vectors in a manner more useful than \code{\link[base]{interaction}}.
18
+
Recodingisabasicstepinanyanalysis.Itisfairlyeasytorecodeasingle variable (e.g.byreplacingvaluesinthevectororusingthe \code{recode} functionin \bold{car} or \code{mapvalues} in \bold{plyr}), butitcanbecumbersometorecodemultiplevariablesintoasinglevector.Thisisusefulwhen, forexample, afactorialexperimenthasthegroupforeachfactorstoredasseparatevariables, butanalysiswillbeperformedacrosstheentire design (ratherthanfactor-by-factor), orwhenitisnecessarytocreateafactorrepresentingmultivariatecombinationsofdemographic groups (e.g., anage-sex-racestratification) fromasetofseparateinputvectorsrepresentingeachdemographicvariable.Thatwouldnormallyrequireaseriesof \code{\link[base]{ifelse}} statementsorcomplexuseofbooleanarguments.Thisfunctionaimstomakeitsimpletocreateasinglevectorfrommultipleinputvectorsinamannermoreusefulthan \code{\link[base]{interaction}}.
0 commit comments