I have been working in SPSS and need to know how to run a discriminant analysis in R. I imagine my syntax which look like this in SPSS
> GET DATA /TYPE=XLSX
>/FILE='C:\Users\Downloads\Initial Diabetics Data 10000.xlsx'
>/SHEET=name 'Initial Diabetics Data 10000.xl'
>/CELLRANGE=full /READNAMES=on
>/ASSUMEDSTRWIDTH=32767.
>EXECUTE.
>DATASET NAME DataSet1 WINDOW=FRONT.
>
>
>
> DELETE VARIABLES weight.
>
>
> DISCRIMINANT
>/GROUPS=readmitted(0 1)
>/VARIABLES=age
> admission_type_id discharge_disposition_id admission_source_id
> lengthofstay num_lab_procedures num_procedures num_medications number_outpatient
> number_emergency number_inpatient number_diagnoses
>/ANALYSIS ALL
>/SAVE=CLASS
>/METHOD=WILKS
>/FIN=3.84
>/FOUT=2.71
>/PRIORS EQUAL
>/HISTORY
>/STATISTICS=CORR TABLE
/PLOT=CASES
/CLASSIFY=NONMISSING POOLED.
Should look something like below in R? What is the syntax for a basic discriminant analysis in R using wilks lambda and saving the predicted groups?
> library(readxl)
> Initial_Diabetics_Data_10000 <- read_excel("C:/Users/Downloads/Initial Diabetics Data 10000.xlsx")
> View(Initial_Diabetics_Data_10000)
>df <-df Initial_Diabetics_Data_10000 select(-weight)
>DISCRIMINANT
?