R/general-loglike.R
covariate_df_to_mat.Rd
Take data frame and turn it into matrix for logistic regression
covariate_df_to_mat(mc_trees, cov_names)
mc_trees | data frame with cov_names |
---|---|
cov_names | null or string of vector |
matrix of dimension n x (p+1)
if cov_names is NA
, then we return a matrix of 1 column of 1s. This is the case of having \(beta_0\) only. Otherwise, we return the matrix with 1 column of 1s for the intercept and the rest of the variables.