# Automated variable selection with unique variables

I have a dataset which contains areas covered by different landuse variables such as agriculture, forest, grassland etc for different spatial scales. The spatial scales that I have used are

1. 30 m riparian scale = P
2. 15 km riparian scale = Q
3. 30 km riparian scale = R
4. 30 km ring scale = S
5. Whole watershed = T

The landuse variables are : Ag, For, Urb, Grs and Oth which refers to agriculture, forest, urban, grassland and others respectively. PAR, Temp and Elevation are other variables affecting productivity. I want to know

• what kind of landuse classification is the best to understand factors affecting productivity in rivers
• which landuse variable affects productivity in which spatial scale

The actual dataset has 102 observations with 30 variables. I am currently using "glmulti" package in R for automated variable selection. The program is still running because I have 2^n i.e. 2^30 models to run.

Currently the best model is something like this:

GPPC ~ 1 + Temp + PFor + QAg + QFor + QUrb + RAg + RFor + RGrs + RUrb + ROth

But, rather than this, I would like the variable selection to include each of the landuse variable only once, for example,

GPPC ~ 1 + Temp + PAg + RFor + RUrb + SGrs + SOth

Arranging my data like this

Is there any way to perform automated analysis and get results like this?

I thought of arranging my data like this.

But then I couldn't incorporate the "Class" i.e. spatial scale in the model.

Note: I have already used MuMin package and used dredge function but it took a very long time to process it. I could also select few variables using PCA but due to the nature of my analysis, I would like to use all the variables in a single model.

• If you have to build $2^30$ models then you are screwed, that's not going to happen. Anyway, this looks like a job for LASSO regression, it's main purpose is feature selection and it does so much quicker. If you have some groups of variables (for ex. landuse) of which you want to select only one of them, then take a look at GROUP LASSO. – user2974951 Jan 9 at 8:10
• @user2974951 Thanks for your suggestion. I will try giving LASSO regression a shot. – Ana Jan 10 at 1:26

If you are interested in identifying important relationships between variables, and understanding if these vary with spatial scale, then I would suggest you run a PCA on your data, arranged just how you have it - excluding class. From here you can then conduct a PERMANOVA on the PCA object to determine which variables differ, and how, between the land-use classes. You might need to build a separate one for each spatial scale, especially if variables are not standardised. The vegan package can do all this and you could easily produce some nice descriptive plots to show your findings.