[R] (no subject)
abigailclifton at me.com
abigailclifton at me.com
Sun Apr 1 17:49:43 CEST 2012
Hi there,
I have this code:
Prepared_Data <- na.omit(read.csv("Prepared_Data.csv", header=TRUE))
pd <- Prepared_Data[,-3] ## data minus response variable
## how many levels per variable?
lev <- sapply(pd,function(x) length(unique(x)))
## total parameters for n variables
par(las=1,bty="l")
plot(cumprod(lev),log="y")
library(Matrix)
m <- sparse.model.matrix(~.^2,data=pd) ## slower than model.matrix
ncol(m) ##8352 columns (!!)
library(glmnet)
g1 <- glmnet(m,Prepared_Data$C3, family="binomial")
Coef(g1)
Which prints out the coefficients of g1. However there are very few numerical coefficients, and many dots. Is there any way to get numerical values for all factors/terms, making it a more complete model without lots of gaps?
Kind regards,
A
Sent from my BlackBerry smartphone from Virgin Media
More information about the R-help
mailing list