pact.fit
Fits a predictive model using data on all subjects. Currently supports
Cox PH and logistic regression models for 'survival' and 'binary' response types
respectively.
pact.fit(Y, Xf = NULL, Xv, Treatment, family = c("binomial", "cox"), varSelect = c("none", "univar", "lasso"), nsig = ifelse(varSelect == "univar", ifelse(nCovarv < 10, 3, 10), NA), cvfolds.varSelect = ifelse(varSelect == "lasso", 5, NA), which.lambda = ifelse(varSelect == "lasso", ifelse(nCovarv < 10, "min", "1se"), NA), penalty.scaling = ifelse(varSelect == "lasso", 0.5, NA))
family='binomial'
, Y should be a factor with two
levels. For family='cox'
, Y should be a two-column matrix with columns named 'time'
and 'status'. The latter is a binary variable, with '1' indicating death, and '0'
indicating right censored.In the case of "lasso", an internal cross-validation loop is used to find the penalty value that minimizes the cross-validated error. The user can choose either the value of the penalty 'lambda' as the penalty that minimizes the cross-validated error ("lambda.min") or the largest penalty for which the cross-validated error is within 1 standard error of the minimum ("lambda.1se"). Also, in the case of "lasso", differential shrinkage can be specified for main effect and interaction effect predictive coefficients by specifying a value for the ratio of shrinkage for main coefficients to shrinkage for interaction coefficients. Internally, 'lambda' is scaled using this ratio to allow for the differential shrinkage of main and interaction coefficients.The penalty factors affect only variables in Xv and not Xf.
data(prostateCancer)
Y <- prostateCancer[,3:4]
Xf <- prostateCancer[,7:8]
Xv <- prostateCancer[,c(5:6,9)]
Treatment <- as.factor(prostateCancer[,2])
pact.fit(Y=Y, Xf=Xf, Xv=Xv, Treatment=Treatment, family="cox",varSelect="univar")
Run the code above in your browser using DataLab