Hi,
I'm trying to output population standard deviation , not just standard deviation. On SQL, it is simple as using the std_pop. Is there anyway on SAS that I can turn the keys on proc univariate and proc means?
Hi @lydiawawa,
You can also use the VARDEF=N option of PROC MEANS (same in PROC UNIVARIATE) to switch from sample to population standard deviation.
I think you you have to run PROC MEANS and create an output data set, then in a DATA step you take the outputs from PROC MEANS and then multiply by the proper factor to convert it to the population standard deviation.
@lydiawawa wrote:
How do you convert the sum function with multiple layers of groups?
Is this related to your first question? Can you provide more explanation of what you are asking?
If I want to compute pop standard deviation of supposedly college admission rate among counties by state. How should I convert mean to population standard deviation ?
State County College Admission Rate
MA 01 0.7
MA 03 0.5
VA 02 0.3
VA 05 0.4
VA 07 0.6
Mean:
State College Admission Rate
MA 0.6
VA 0.43
How do I convert the sum function and derive the pop std manually?
I'm afraid I don't understand. You keep jumping from standard deviation to mean and back. Please explain in more detail.
When I spoke about using PROC MEANS, it was to get a sample standard deviation. Then you can multiply the sample standard deviation by the proper factor to get the population standard deviation. You don't need to do anything manually here (other than write the proper code) and you don't specifically need to compute the mean and then use it, because PROC MEANS does that internally.
Hi @lydiawawa,
You can also use the VARDEF=N option of PROC MEANS (same in PROC UNIVARIATE) to switch from sample to population standard deviation.
@FreelanceReinh wrote:
You can also use the VARDEF=N option of PROC MEANS (same in PROC UNIVARIATE) to switch from sample to population standard deviation.
I forgot about that. Definitely a better solution than what I was suggesting.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.