Dealing with groups of high dimensional data I've got a dataset that follows patients who underwent different treatment options for aneurysms. They can have more than one aneurysm and each may be treated differently.
So I have variables like:
Treatment1, treatment2, treatment3, where 1, 2 and 3 are different treatments.
size1, size2, size3 where the numbers identify which aneurysm, this follows:
location1, location2, etc. So location1 and size1 are connected, ie. it's aneurysm "number one" that has a specific location and size.
Then we also have adverse effect per aneurysm so adverse1, adverse2, adverse3.
I'm interested to see if aneurysm size, location and treatment option are correlated with outcome (adverse effect).
I've thought about model selection and perhaps using a mixed model would be the best here? How would you approach such a data structure?
EDIT: I believe I have the data formatted as well as I can. I have created variables explaining size and location for each aneurysm, but I'm not sure where to go from here. Let's assume you want to know, from this data, whether location of aneurysms is correlated with size. How would you about doing that? Normally I would regress size vs location but these are 5 sizes and 5 locations, one for each aneurysm.
Picture of data.
 A: You don't want to be doing dimensionality reduction (as suggested in the question comments) here.
The problem is that your data are in wide format, and to analyse them with a regression model you need them in long format.
At present you appear to have 1 row per patient. What you need is 1 row per aneurysm.
You should have columns for

*

*Patient ID

*Aneurysm ID instead of different columns for different aneurysms

*Aneurysm Location instead of different columns for different aneurysm location

*Aneurysm Size instead of different columns for the sizes of different aneurysm.

*The treatment for that particular aneurysm

*The adverse outcome variable for that particular aneurysm

...and that's about it unless there are other variables not mentioned
So to illustrate:
PatientID AnID AnLoc AnSize Treat Adverse
1          1    A     2       1     Y
1          2    B     2       1     N
2          1    C     3       1     N
3          1    A     4       2     Y
4          1    C     3       2     N
4          2    D     2       3     Y
4          3    E     3       1     N
5          1    C     3       1     N
6          1    A     2       1     Y
7          1    A     3       2     N
7          2    B     4       2     N

[obviously I don't know the details of your data, so obviusly some combinations might not make sense but hopefully you get the idea.]
Then you would run a mixed effect model with random intercepts for patient, and aneurysm nested in patient.
Adverse ~ Treat + AnSize + AnLoc + (1|PatientID/AnID)

If there is only one measurement for each aneurysm then you don't need to include AnID
This will estimate the associations of treatment, aneurysm size and location on an adverse outcome. You might also consider inteactions between these variables.
If Advserse is binary then it should be a logistic model.
However, some care is need to ensure that you don't include mediators on the causal path - for example if location affects treatment, then you don't want to include treatment in the same model because it is a mediator and it will bias the estimate for location. Similarly if size affects treatment you would again not want to include treatment.
A: You can try using the GLM in R like:
aneu.fact <- as.factor(data$aneurysm.sz)
loc.fact <- as.factor(data$location)
treat.fact <- as.factor(data$treatment)

glm.1 <- glm(adverse$eff ~ aneu.fact + loc.fact + treat.fact, family=poisson)
summary(glm.1)

This example uses a GLM (Generalized Linear Model) with a poisson link function (more on this here).
The summary() function will output the p values for each variable regarding its' significance in response variable prediction.
If you want to select features based on their contribution to prediction, you can use the step() function in R, that in each iteration will get one feature out, and calculate several criterions for model performance.
aneu.fact <- as.factor(data$aneurysm.sz)
loc.fact <- as.factor(data$location)
treat.fact <- as.factor(data$treatment)

glm.1 <- step(glm(adverse$eff ~ aneu.fact + loc.fact + treat.fact, family=poisson))
summary(glm.1)

If you want to account for random effects inside the features, you can use the lmer() function of the lme4 package, and account for that by the ((1|feature) syntax):
aneu.fact <- as.factor(data$aneurysm.sz)
loc.fact <- as.factor(data$location)
treat.fact <- as.factor(data$treatment)

glme.1 <- glmer(adverse$eff ~ (1|aneu.fact) + loc.fact + treat.fact), family = poisson)
summary(glme.1)

Cheers.
