Displaying 2 results from an estimated 2 matches for "surv_obj".
Did you mean:
drv_obj
2013 Jul 06
1
problem with BootCV for coxph in pec after feature selection with glmnet (lasso)
...requested are predicted probabilities for
118 subjects (rows) in newdata and 356 time points (columns)
This may happen when some covariate values are missing in newdata!?
Here are the relevant sections of the code:
trainSet <- na.omit (dataset)
#creat Y (survival matrix) for glmnet
surv_obj <- Surv(trainSet$time,trainSet$status)
## tranform categorical variables into binary variables with dummy for
trainSet
predict_matrix <- model.matrix(~ ., data=trainSet,
contrasts.arg = lapply
(trainSet[,sapply(trainSet, is.factor)], contrasts, c...
2013 Sep 13
1
Creating dummy vars with contrasts - why does the returned identity matrix contain all levels (and not n-1 levels) ?
Hello,
I have a problem with creating an identity matrix for glmnet by using the
contrasts function.
I have a factor with 4 levels.
When I create dummy variables I think there should be n-1 variables (in this
case 3) - so that the contrasts would be against the baseline level.
This is also what is written in the help file for 'contrasts'.
The problem is that the function