We have an experiment that seeks to establish a particular continuous quantity as a possible objective indicator of some subjective categories. Since we cannot share the particular experiment (company confidentiality), here are two other scenarios that I think are similar.

1. Subjective quality of wines such as "full bodied", "fruity", etc. and we imagine that we have measured a chemical that has differing concentrations in the wines that are labeled full bodied versus those that are not. There are a few (say 4) subjective categories, for each of which we obtain 100 samples of wine, and measure the chemical. Finally, ***the test:*** Take the mean value of the chemical in each of the four categories, and see if these means are significantly different.
2. Mental disease, going back to a time when certain mental disorders (schizophrenia, a couple others) were diagnosed subjectively. For each of the diseases, we find 100 people who have been diagnosed with that disease, and take an objective measurement (brain chemical or something). 
Then ***test:*** Take the mean value of the chemical for each group of people, and see if these means are significantly different.

The examples are not great. For one, I know nothing about either topic (wine or mental disease). So please understand that these are attempts at examples, and don't focus on them.

*In summary, we seek to test if the means of a small number of groups are different, where the members of each group are samples from a larger population.*

As a starting point, if there were two categories, a t-test would come to mind (checking that the assumptions of the t-test are ok.)

Here there are N categories (small N), so it's one way anova, which I think would be 

```
model <- lm(Chemical ~ Category, data=Data)

```

where Category is a column with factor() applied.

And the sampling of the particular 1000 wines or people is a random effect. Correct?

Would this be the model with the random effect?

```
model <- lmer(Chemical ~ Category + Error(SampleID), data=Data)

```

EDIT: question is clarified, it had left out the goal of testing for different means! Removed the part about causality, will save that for a separate question.

EDIT: I believe that the basic situation is a test for difference in means between several groups defined by the categories (full-bodied vs fruity vs etc, or schizophrenia vs bipolar vs others), so ANOVA is the starting point. The only change is that there is the random effect resulting from sampling members of each category from a population (e.g. 100 people sampled from the larger population of people with schizophrenia). Without the random effect, the R model would be model <- lm(Chemical ~ Category, data=Data). How can the random effect be specified?