Hi,
Please explain what is the actual purpose of proc univariate and histogram codes in the below program, I have tired to find clarity in google but it lead to further confusions. Could anyone please explain this in simple words.
Many thanks.
data grades;
input Name & $14. Gender : $1. Section : $3. ExamGrade1 @@;
datalines;
Abdallah F Mon 46
Anderson M Wed 75
Aziz F Wed 67
Bayer M Wed 77
Bhatt M Fri 79
Blair F Fri 70
Bledsoe F Mon 63
Boone M Wed 58
Burke F Mon 63
Chung M Wed 85
Cohen F Fri 89
Drew F Mon 49
Dubos M Mon 41
Elliott F Wed 85
Farmer F Wed 58
Franklin F Wed 59
Freeman F Mon 79
Friedman M Mon 58
Gabriel M Fri 75
Garcia M Mon 79
Harding M Mon 49
Hazelton M Mon 55
Hinton M Fri 85
Hung F Fri 98
Jacob F Wed 64
Janeway F Wed 51
Jones F Mon 39
Jorgensen M Mon 63
Judson F Fri 89
Kuhn F Mon 89
LeBlanc F Fri 70
Lee M Fri 48
Litowski M Fri 85
Malloy M Wed 79
Meyer F Fri 85
Nichols M Mon 58
Oliver F Mon 41
Park F Mon 77
Patel M Wed 73
Randleman F Wed 46
Robinson M Fri 64
Shien M Wed 55
Simonson M Wed 62
Smith N M Wed 71
Smith R M Mon 79
Sullivan M Fri 77
Swift M Wed 63
Wolfson F Fri 79
Wong F Fri 89
Zabriski M Fri 89
run;
proc univariate data= grades;
histogram examgrade1;
title 'introductory Chemistry Exam Scores';
run;
Histogram - creates a histogram.
https://www.khanacademy.org/math/pre-algebra/pre-algebra-math-reasoning/pre-algebra-picture-bar-grap...
PROC UNIVARIATE is basically doing exploratory data analysis on data:
https://towardsdatascience.com/exploratory-data-analysis-8fc1cb20fd15
Why are you doing this? We can't know the answer to that, that's something you need to ask whoever told you to do this. If you're trying to learn statistics and SAS perhaps you should consider taking the first SAS Statistics course - it's online and on demand, and free.
https://support.sas.com/edu/schedules.html?ctry=us&crs=STAT1
You want to simplify three lines of code? I don't think that makes sense at all. The first set of the code is creating your data to analyze, that cannot be simplified.
@Deepak13 wrote:
Could you be more specific? how does it examine? If you don't mind explanation with a simpler program would do more good! @Reeza
Many thanks.
Are you asking what a histogram is or what PROC UNIVARATE does?
I need to know why proc univariate is used in this code? and how histogram works in this code?
Yes @PeterClemmensen
Question via @PeterClemmensen
Are you asking what a histogram is or what PROC UNIVARATE does?
Answer: Yes
That is not a yes/no question. Please take the time to provide clear information if you would like help, this is a volunteer user community.
To examine the distribution of the variable examgrade1.
@Deepak13 wrote:
Hi,
Please explain what is the actual purpose of proc univariate and histogram codes in the below program, I have tired to find clarity in google but it lead to further confusions. Could anyone please explain this in simple words.
Many thanks.
data grades;
input Name & $14. Gender : $1. Section : $3. ExamGrade1 @@;
datalines;
Abdallah F Mon 46
Anderson M Wed 75
Aziz F Wed 67
Bayer M Wed 77
Bhatt M Fri 79
Blair F Fri 70
Bledsoe F Mon 63
Boone M Wed 58
Burke F Mon 63
Chung M Wed 85
Cohen F Fri 89
Drew F Mon 49
Dubos M Mon 41
Elliott F Wed 85
Farmer F Wed 58
Franklin F Wed 59
Freeman F Mon 79
Friedman M Mon 58
Gabriel M Fri 75
Garcia M Mon 79
Harding M Mon 49
Hazelton M Mon 55
Hinton M Fri 85
Hung F Fri 98
Jacob F Wed 64
Janeway F Wed 51
Jones F Mon 39
Jorgensen M Mon 63
Judson F Fri 89
Kuhn F Mon 89
LeBlanc F Fri 70
Lee M Fri 48
Litowski M Fri 85
Malloy M Wed 79
Meyer F Fri 85
Nichols M Mon 58
Oliver F Mon 41
Park F Mon 77
Patel M Wed 73
Randleman F Wed 46
Robinson M Fri 64
Shien M Wed 55
Simonson M Wed 62
Smith N M Wed 71
Smith R M Mon 79
Sullivan M Fri 77
Swift M Wed 63
Wolfson F Fri 79
Wong F Fri 89
Zabriski M Fri 89
run;
proc univariate data= grades;
histogram examgrade1;
title 'introductory Chemistry Exam Scores';
run;
Could you be more specific? how does it examine? If you don't mind explanation with a simpler program would do more good! @Reeza
Many thanks.
Histogram - creates a histogram.
https://www.khanacademy.org/math/pre-algebra/pre-algebra-math-reasoning/pre-algebra-picture-bar-grap...
PROC UNIVARIATE is basically doing exploratory data analysis on data:
https://towardsdatascience.com/exploratory-data-analysis-8fc1cb20fd15
Why are you doing this? We can't know the answer to that, that's something you need to ask whoever told you to do this. If you're trying to learn statistics and SAS perhaps you should consider taking the first SAS Statistics course - it's online and on demand, and free.
https://support.sas.com/edu/schedules.html?ctry=us&crs=STAT1
You want to simplify three lines of code? I don't think that makes sense at all. The first set of the code is creating your data to analyze, that cannot be simplified.
@Deepak13 wrote:
Could you be more specific? how does it examine? If you don't mind explanation with a simpler program would do more good! @Reeza
Many thanks.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.