01-07-2013 08:02 PM
Hi, I have the following values, and I'd like to get a mean for the defined categories of 8 through 18 ONLY. How should I write my code so that I can get the mean values that belong to all that fall in the categories of 8 through 18? Thanks.
1='Possession of Light'
2='No possession of light'
3='Counting fingers at 1m'
4='Counting fingers at 2m'
5='Counting fingers at 3m'
6='Counting fingers at 4m'
7='Counting fingers at 5m'
01-08-2013 01:29 PM
If you want the mean for each level of selectvar, add a class statement.
PROC MEANS DATA=have(where=(selectvar between 8 and 18)) MEAN;
01-08-2013 08:33 PM
You didn't provide your variable names, so Tom's used short hand notation, selecvar = select variable - variables used to filter your selection.
analvar is your analysis variable, what you want the summary of.
Between DOES include the boundary values. If it didn't (but it does) you could always just increment/decrease your boundary values (7, 19).
01-08-2013 08:06 PM
Thanks for your reply. When we use the WHERE statement with *between* 8 and 18, my understanding is that we're not including the categories 8 and 18. Is there any other way to code so that I can actually include the categories 8 and 18, not just from 9 to 17?