(no subject)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

abigailclifton
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

______________________________________________
[hidden email] 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.