search for: ckalexa2

Displaying 4 results from an estimated 4 matches for "ckalexa2".

2011 Dec 15
2
Data Manipulation - make diagonal matrix of each element of a matrix
...c(matrix(rep(diag(1,tt),n),ncol=tt, byrow=TRUE)) * rep(rep(x[,i],each=tt),tt) , ncol=tt) } X It works fine, but is there an easier way when n, tt, and numco get larger and larger? Thanks, Tina -- Clemontina Alexander Ph.D Student Department of Statistics NC State University Email: ckalexa2 at ncsu.com
2011 Sep 09
4
Very simple question about list components
I have a list 'ans' from the following code: tt <- rnorm(50) rr <- rnorm(50) ans <- lm(rr~tt) ans[1] is "$coefficients", ans[2] is "$residuals", ans[3] is "$effects", ... and so on up to ans[12]. Is there an easy way to display just these names and not the data they contain? I thought I saw my advisor type "ans$" and they were displayed,
2012 Nov 11
4
Multiplying elements of a list by rows of a matrix
Hi all, I have the following code: set.seed(1) x1 <- matrix(sample(1:12), ncol=3) x2 <- matrix(sample(1:12), ncol=3) x3 <- matrix(sample(1:12), ncol=3) X <- list(x1,x2,x3) tt <- matrix(round(runif(5*4),2), ncol=4) Is there a way I can construct a new list where newlist[[i]] = tt[i,] %*% X[[i]] without using a for loop? Each element of newlist will be 3 x 1 vector. Thanks -- Tina
2011 May 02
2
Lasso with Categorical Variables
Hi! This is my first time posting. I've read the general rules and guidelines, but please bear with me if I make some fatal error in posting. Anyway, I have a continuous response and 29 predictors made up of continuous variables and nominal and ordinal categorical variables. I'd like to do lasso on these, but I get an error. The way I am using "lars" doesn't allow for the