I am still a novice ... so easily confused! I was told to compute the means for all explanatory variables (SAS 9.4). But, the variables are all categorical variables. For example, I tried to get the means for the two health reasons (physical and mental health), coded as 1 and 2. I used the following code: proc means data=onespell mean, std; class=healthreason; var=spell_length; run; This is not giving me what I want. Apparently, because the data is stacked, it includes all observations on a person. I just want a one-person file. My co-investigator responded thus "Are you looking for the average for persons in your sample? I am not sure what data is going into the procedure. It appears that the data you are inputting is all the observations on the first spell, so many of those people have multiple observations because they have many months in that spell. If that is the case, then the average will be biased by people who have longer first spells and more observation months. Also, the sample count for the mean will not be people but observation months (many more observation months than people). Lastly, I though you coded health reason as a categorical variable with three categories (0, 1, and 2 or something like that). So that would mean that you are better to look at the proportion of the sample in each category rather an mean value. An average of 0, 1, and 2 values would not give you a meaningful mean value." Serving only to confuse me more. Can someone help me unravel this?
... View more