Re: [R] summated scale

2010-03-20 Thread Ista Zahn
Hi Anthony, Have a look at ?rowSums (if you just want to calculate the score) or ?score.items in the psych package (if you want to calculate alpha's, item-by-scale correlations etc.). -Ista On Sat, Mar 20, 2010 at 4:02 PM, Anthony Lopez wrote: > hello, > > I am new to R (convert from Stata) and

Re: [R] summated scale

2010-03-20 Thread Jorge Ivan Velez
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 (con

[R] summated scale

2010-03-20 Thread Anthony Lopez
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) in