Hi Anthony, Perhaps
?rowSums ?apply ?aggregate ?ave Here is an example: set.seed(123) X <- matrix(rnorm(40), ncol = 4) colnames(X) <- c('x1','x2','x3','x4') X x <- rowSums(X) x cbind(X, x) HTH, Jorge On Sat, Mar 20, 2010 at 4:02 PM, Anthony Lopez <> wrote: > hello, > > I am new to R (convert from Stata) and I am wondering if there is an R > command/function for generating a summated scale from, for example, four > separate variables in a data set. In other words, I want to transform the > variables x1, x2, x3, and x4 (which have high inter-item reliability) into > one new summated variable x'. Can't seem to find it in the psy or psych > package ... > > Thanks for any suggestions! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.