Question: How do i change the R code, so i can perform Logistic regression and QDA (seperate) X = names(mtcars[,-1]) X [1] cyl disp hp drat

How do i change the R code, so i can perform Logistic regression and QDA (seperate)

X = names(mtcars[,-1]) X [1] "cyl" "disp" "hp" "drat" "wt" "qsec" "vs" "am" "gear" "carb" out <- unlist(lapply(1:length(X), function(n) combn(X, n, FUN=function(row) paste0("mpg ~ ", paste0(row, collapse = "+"))))) mods = lapply(out, function(frml) lm(frml, data=mtcars)) # i guess i have to change frml and lm, but i do not know to what. Please provide an solution for logistic regression or QDA or both.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!