How to encode an n-level categorical variable as dummies, for glmnet? When feeding a categorical variable into glmnet do I code n or n-1 dummy variables?
For instance if using days of the week as an independent variable would I use 6 dummies or 7?
If the answer is 6, how do I interpret coefficients, etc for dropped category?
EDIT:
Here's some example code:
library(glmnet)
library(caret)

df1 <- data.frame(id = 1:210, var1 = rep(c('Mon','Tues','Wed','Thurs','Fri','Sat','Sun'),30))
df1$targetVar <- runif(210)
    df1$mktVol <- round(runif(210)*1000000,0)
df1$mktVol <- ifelse(df1$var1 %in% c('Sat','Sun'), 0, df1$mktVol)

df1
vtu <- c('mktVol','var1')
dv1 <- dummyVars( ~.,data = df1[,vtu])
df2 <- data.frame(predict(dv1,df1))

glmnet1 <- cv.glmnet(df2$targetVar, data.matrix(df2[,-c('targetVar')]), nfolds = 5)

glmnet1 <- cv.glmnet( data.matrix(df2[,-1]), df2[,"mktVol"] ,
      family="gaussian", alpha=.95, nfolds=5, standardize = FALSE,
      type.measure="mse")

Coefficients1 <- coef(glmnet1, s = glmnet1$lambda.min)
Active.Index <- which(Coefficients != 0)
Active.Coefficients <- Coefficients[Active.Index]
names(X1)[varsToUse[Active.Index]]

##############################

df1 <- data.frame(id = 1:210, var1 = rep(c('Mon','Tues','Wed','Thurs','Fri','Sat','Sun'),30))
df1$targetVar <- runif(210)
    df1$mktVol <- round(runif(210)*1000000,0)
df1$mktVol <- ifelse(df1$var1 %in% c('Sat','Sun'), 0, df1$mktVol)

df1
vtu <- c('mktVol','var1')
#dv1 <- dummyVars( ~.,data = df1[,vtu])
#df2 <- data.frame(predict(dv1,df1))
dv1 <- model.matrix(~.,data = df1[,vtu])

#glmnet1 <- cv.glmnet(df2$targetVar, data.matrix(df2[,-c('targetVar')]), nfolds = 5)

glmnet1 <- cv.glmnet( data.matrix(df2[,-1]), df2[,"mktVol"] ,
      family="gaussian", alpha=.95, nfolds=5, standardize = FALSE,
      type.measure="mse")

Coefficients2 <- coef(glmnet1, s = glmnet1$lambda.min)

##############################

df1 <- data.frame(id = 1:210, var1 = rep(c('Mon','Tues','Wed','Thurs','Fri','Sat','Sun'),30))
df1$targetVar <- runif(210)
    df1$mktVol <- round(runif(210)*1000000,0)
df1$mktVol <- ifelse(df1$var1 %in% c('Sat','Sun'), 0, df1$mktVol)

df1
vtu <- c('mktVol','var1')
#dv1 <- dummyVars( ~.,data = df1[,vtu])
#df2 <- data.frame(predict(dv1,df1))
dv1 <- model.matrix(~ 0+ .,data = df1[,vtu])

#glmnet1 <- cv.glmnet(df2$targetVar, data.matrix(df2[,-c('targetVar')]), nfolds = 5)

glmnet1 <- cv.glmnet( data.matrix(df2[,-1]), df2[,"mktVol"] ,
      family="gaussian", alpha=.95, nfolds=5, standardize = FALSE,
      type.measure="mse")

Coefficients3 <- coef(glmnet1, s = glmnet1$lambda.min)
Coefficients1 
Coefficients2 
Coefficients3 

 A: "In the extreme case of k identical predictors, they each get identical coefficients with 1=kth the size that any single one would get if t alone. From a Bayesian point of view, the ridge penalty is ideal if there are many predictors, and all have non-zero coefficients (drawn from a Gaussian distribution).
Lasso, on the other hand, is somewhat indifferent to very correlated predictors, and will tend to pick one and ignore the rest. In the extreme case above, the lasso problem breaks down. The Lasso penalty corresponds to a Laplace prior, which expects many coefficients to be close to zero, and a small subset to be larger and nonzero."
Page 4, Regularization Paths for Generalized Linear Models via Coordinate Descent, Jerome Friedman, Trevor Hastie, Rob Tibshirani.
So, you can leave all of them in--since Ridge guarantees that the (X'X) matrix is invertible---but I wouldn't recommend it.
A: The question seems have little thing to do with glmnet, but factor encoding and interpretation on coefficient in general. 
I would suggest to look at logistic regression that uses categorical variables as a start. R Library: Contrast Coding Systems for categorical variables a great resource to learn different types of encoding and interpretation. The key is "comparing to base level". For example, if we want to encode days of weeks. We can use Sunday as a base level, and all other days will compare against it.
