PROC MEANS AND PROC SUMMARY
2011-04-17 21:04
267 查看
两者最大的不同是MEANS结果是print table,而SUMMARY的结果是一个数据集。
利用output选项二者可以实现同样的功能。
例如:
proc means data=sashelp.class noprint;
var weight;
output out=summrydat1;
run;
proc summary data=sashelp.class;
var weight;
output out=summrydat2;
run;
另外,可以对统计量重命名
例如:
proc summary data=sashelp.class;
var weight;
output out=summrydat n=number mean=average std=std_deviation;
run;
proc summary data=sashelp.class;
var height weight;
output out =summrydat
n =ht_n wt_n
mean(weight)= wt_mean
std(height) = ht_std;
run;
还有,CLASS语句,类似于FREQ的CLASS语句
title1 'CLASS and a Printed Table';
proc means data=sashelp.class;
class age sex;
var height;
output out=clsummry1 n=ht_n mean=ht_mean std=ht_sd;
run;
使用CLASS语句,MEANS和SUMMARY自动生成的_TYPE_值不同,它们用来区别统计量。
“
_TYPE_ = 0 Summarize across all classification variables
总结所有分类变量
_TYPE_ = 1 Summarize as if the right most classification variable was the only one
对将数据最右边的分类变量作总结
_TYPE_ = 2 Summarize as if the next to the right most classification variable was the only one
对数据右边第二个分类变量作总结
_TYPE_ = 3 Interaction of the two classification variables.
两分类变量间交互作用
”
比如上面代码的结果为:
_type_=0,统计量对所有变量计算所得
_type_=1,对满足分类变量sex计算所得
_type_=2,对满足分类变量age计算所得
_type_=3,则是同时对满足分类变量sex,age计算所得
利用output选项二者可以实现同样的功能。
例如:
proc means data=sashelp.class noprint;
var weight;
output out=summrydat1;
run;
proc summary data=sashelp.class;
var weight;
output out=summrydat2;
run;
另外,可以对统计量重命名
例如:
proc summary data=sashelp.class;
var weight;
output out=summrydat n=number mean=average std=std_deviation;
run;
proc summary data=sashelp.class;
var height weight;
output out =summrydat
n =ht_n wt_n
mean(weight)= wt_mean
std(height) = ht_std;
run;
还有,CLASS语句,类似于FREQ的CLASS语句
title1 'CLASS and a Printed Table';
proc means data=sashelp.class;
class age sex;
var height;
output out=clsummry1 n=ht_n mean=ht_mean std=ht_sd;
run;
使用CLASS语句,MEANS和SUMMARY自动生成的_TYPE_值不同,它们用来区别统计量。
“
_TYPE_ = 0 Summarize across all classification variables
总结所有分类变量
_TYPE_ = 1 Summarize as if the right most classification variable was the only one
对将数据最右边的分类变量作总结
_TYPE_ = 2 Summarize as if the next to the right most classification variable was the only one
对数据右边第二个分类变量作总结
_TYPE_ = 3 Interaction of the two classification variables.
两分类变量间交互作用
”
比如上面代码的结果为:
_type_=0,统计量对所有变量计算所得
_type_=1,对满足分类变量sex计算所得
_type_=2,对满足分类变量age计算所得
_type_=3,则是同时对满足分类变量sex,age计算所得
相关文章推荐
- Machine Learning week 8 programming exercise K-means Clustering and Principal Component Analysis
- LoadLibrary And GetProcAddress And FreeLibrary
- Machine Learning week 8 quiz: programming assignment-K-Means Clustering and PCA
- Ruby学习笔记-Block, Proc and Lambda
- Mixing Objective-C, C++ and Objective-C++: an Updated Summary
- An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means
- [ZZ]INSERT ON DUPLICATE KEY UPDATE and summary counters
- 【SAS NOTE】在proc means中根据某变量的范围进行统计+proc format
- Coursera Machine Learning 第八周 quiz Programming Exercise 7 K-means Clustering and Principal Component
- Plotting means and error bars (ggplot2)
- "Yes" means "maybe," maybe" means "no," and "no" is never spoken.
- PBM, PGM, PNM, and PPM File Format Summary
- Summary: difference between public, default, protected, and private key words
- Summary on Visual Tracking: Paper List, Benchmarks and Top Groups
- A summary: how to use bit manipulation to solve problems easily and efficiently
- Share And Summary
- Machine Learning 第七波编程作业——K-means Clustering and Principal Component Analysis
- Fast and Provably Good Seedings for k-Means阅读笔记
- 《How to be a Programmer: A Short, Comprehensive, and Personal Summary》翻译计划
- k-means clustering and pca