Dear community, As a beginner in this community I would request a help. is the code for the question
" What is the mean value of the Sales variable for observations in the “Middle” group? Round
your answer to the nearest whole number. " correct or please suggest any modification.
proc means data= work.shoesrange nolabels mean;
I can't see your data, so I can only guess that the "Middle" group is in the salesrange variables.
In that case, yes, your code is fine and will give you the mean value for the "Middle" group in the Results Viewer.
You could specify the MAXDEC Option in the Proc Means Statement to specify the desired number of decimals.
Since you only want one group, you should restrict the observations to that group.
You also want only one variable averaged, so you should tell the procedure that.
proc means data=shoesrange nolabels mean; where salesrange = "Middle"; /* if "Middle" is in fact the result of a custom format applied to salesrange, this must be adapted */ var sales; run;
Alternatively, you can use SQL:
proc sql; select avg(sales) as average_sales from shoesrange where salesrange = "Middle"; quit;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.