### Not run
### example of an entire analysis with FADA package if a testing data set is available
### loading data
# data(data.train)
# data(data.test)
# dim(data.train$x) # 30 250
# dim(data.test$x) # 1000 250
### decorrelation step
# res = FA(data.train,data.test) # Optimal number of factors is 2
### decorrelation of the training data set only
# res = FA(data.train)
### decorrelation of the testing data set afterward
# res2 = decorrelate(res,data.test)
### classification step with sda, using local false discovery rate for variable selection
### linear discriminant analysis
# FADA.LDA = FADA(res,method="sda",sda.method="lfdr")
### diagonal discriminant analysis
# FADA.DDA = FADA(res, method="sda",sda.method="lfdr",diagonal=TRUE)
### example of an entire analysis with FADA package if no testing data set is available
### loading data
### decorrelation step
# res = FA(data.train) # Optimal number of factors is 2
### classification step with sda, using local false discovery rate for variable selection
### linear discriminant analysis, error rate is computed by leave-one-out CV
# FADA.LDA = FADA(res,nfold.cv = length(data.train$y),method="sda",sda.method="lfdr")
Run the code above in your browser using DataLab