How to use logical Discriminant and descriptive Statistical function in PROC SQL
This article mainly introduces the PROC SQL logic discrimination and descriptive statistical function how to use, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
1. Logical expression: >, 60); male = (sex ='M'); female = (sex ='F'); run;*proc sql;proc sql; select name, (height > 60) as tall, (sex ='M') as male, (sex ='F') as female from sashelp.class;quit
two。 Descriptive statistical functions sum (), mean (),....
Proc sql; select sex, max (height) as max_ht, mean (weight) as mean_wt from sashelp.class group by sex;quit;proc sql; select age, max (height*height/weight) as max_body_mass_index from sashelp.class group by age;quit
3. Joint use
Proc sql; select max (height > 60) as any_tall, mean (weight > 100) as pct_heavy, sum (gender ='F') as num_female from sashelp.class;quit;proc sql; select sex, max (height > 60) as any_tall, mean (weight > 100) as pct_heavy from sashelp.class group by sex;quit Thank you for reading this article carefully. I hope the article "how to use logical Discriminant and descriptive Statistical functions in PROC SQL" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!