- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I'm new to running Proc PLS and I'm trying to understand if I still need to run cv after choosing the number of factors for my model.
Here's an example of my code and what I'm doing. Is that correct? Thanks for your input. (note: I've purposely removed many of my x-vars from the model I'm showing below to save space)
proc pls data=splitplsr2 cv=random(seed=12345) cvtest varss plots=(diagnostics dmod scores ParmProfiles VIP XLoadingProfiles);
class plat;
model pNmeas = plat
R1Avg_412_d/ solution;
output OUT=test1;
ods output VariableImportancePlot=vip;
title 'Global Model';
run;
/* run model above and choose factors by van der Voet's test*/
/*next code to run for solutions using the designated number of factors*/
proc pls data=splitplsr2 nfac=8 varss plots=(diagnostics dmod scores ParmProfiles VIP XLoadingProfiles);
class plat;
model pNmeas = plat
R1Avg_412_d/ solution;
output OUT=outfile predicted=predpNR1f press=presspNR1f yresidual=yresidpNR1f ;
ods output VariableImportancePlot=vip;
title 'Final Global Model';
run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This is how I do it
- Run cross-validation
- Choose number of factors based upon cross-validation results
- Re-fit model to have the number of factors chosen above
So if I understand you properly, you are doing the same thing. Also, you don't need the variable importance values and most of the other outputs when you are doing the cross-validation run. In that first run of PROC PLS, you just want the cross-validation outputs.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This is how I do it
- Run cross-validation
- Choose number of factors based upon cross-validation results
- Re-fit model to have the number of factors chosen above
So if I understand you properly, you are doing the same thing. Also, you don't need the variable importance values and most of the other outputs when you are doing the cross-validation run. In that first run of PROC PLS, you just want the cross-validation outputs.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content