SAS中保存统计分析步的结果至数据集中_第1页
SAS中保存统计分析步的结果至数据集中_第2页
SAS中保存统计分析步的结果至数据集中_第3页
SAS中保存统计分析步的结果至数据集中_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、sas中保存 统计分析步的 结果 至数据集中在我们做完统计分析步(如proc reg等)后,有时想要将某些 结果数据保存在数据集中,较为简单的常用方法有下面三种:使用proc 步结果输出选项,使用output 语句,使用 ods output的方法。下面以较为常用的proc reg步进行举例说明:1. 使用 proc reg步结果输出选项在 proc reg ; 的 options中可以选择 outest= 选项来产生 一个数据集,用于存储参数估计值、模型拟合的相关统计值等;同时还有edf 、outseb 、tableout 、sse 等选项(其他更多选项参见sas help 文档),可以将你

2、想要的统计分析结果存储于 outest= 生产的数据集中。outest= outputs a data set that contains parameter estimates and other model ? 0? 3t summary statistics edfoutputs the number of regressors, the error degrees of freedom, and the model r2 to the outest= data set outseb outputs standard errors of the parameter estimates t

3、o the outest= data set tableout outputs standard errors, con? 0? 3dence limits, and associated test statistics of the parameter estimates to the outest= data set 例:proc reg data=sashelp.class outest=result1 edf sse; model weight=height; quit; 数据集 work.result1如下:2. 使用 proc reg步的 output语句在 proc reg步中,

4、output 语句语法如下:output ; 使用 output 语句可保存模型拟合后,模型诊断检验的一些数据 结果。由于 proc reg 中可以有多个 model语句,output 对离它最近的 一个 model 有效,并且,需至少定义 一个 keyword=names选项。 keyword= 包括 cookd=、h=、p=、r= 等选项(其他更多选项参见sas help 文档)。cookd= ? 0? 2? 0? 2 ? 0? 2cooks d in ? 0? 4uence statistic h= ? 0? 2? 0? 2 ? 0? 2leverage predicted | p =

5、? 0? 2? 0? 2 ? 0? 2predicted values residual | r = ? 0? 2? 0? 2 ? 0? 2residuals, calculated as actual minus predicted 例:proc reg data=sashelp.class; model weight=height; output out=result2 p=p_value r=residuals; quit; 数据集 work.result2如下:3. 使用 ods output的方法使用 ods output可以将统计分析的 结果的任意 部分存入数据集中。如对proc

6、reg data=sashelp.class; model weight=height; quit; 在 sas的 results窗口下,可以看到proc reg步结果列表另外,使用 ods trace可以在 log 窗口中查看输出 结果,如下ods trace on; proc reg data=sashelp.class; model weight=height; quit; ods trace off; 如想保存 analysis of variance的结果,其属性名为 anova ,代码如下:ods output anova=result3; proc reg data=sashelp.class; model weight=

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论