Lasso regression
Data were randomly split into a training set that included 70% of the observations (N=89) and a test set that included 30% of the observations (N=38). Even though my sample (N=127) was small, I chouse to proceed with splitting my sample so that I can practice more in Lasso regression.
The least angle regression algorithm with k=5 fold cross validation was used to estimate the lasso regression model in the training set, and the model was validated using the test set. The change in the cross validation average (mean) squared error at each step was used to identify the best subset of predictor variables.
Response Variable= Suicide per 100th habitants
8 Explanatory Variables= income per person, alcohol consumption, female employ rate, politygroup (categorial), urban rate, Ranking(categorial), Unemployment, co2emissions
Figure 1. Change in the validation mean square error at each step
2 explanatory variables were retained in the selected model, whose β are still not much different than 0: Alcohol consumption and urban rate. These 2 variables accounted for 12.7% of the variance in the Suicide per 100th habitants response variable.
if cmiss(of _all_) then delete; run;
ods graphics on;
proc surveyselect data=new out=traintest seed = 5 samprate=0.7 method=srs outall; run;
proc glmselect data=traintest plots=all seed=5; partition ROLE=selected(train='1' test='0'); model suicideper100TH= incomeperperson Alcconsumption Femaleemployrate politygroup urbanrate Ranking Unemp co2emissions/selection=lar(choose=cv stop=none) cvmethod=random(5);
run;












