全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1890 2
2010-10-14
用sas建立了线性回归模型,如何在程序中调用各自变量的系数,希望各位高手能指点一下
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2010-10-18 00:41:14
somdat 发表于 2010-10-14 19:53
用sas建立了线性回归模型,如何在程序中调用各自变量的系数,希望各位高手能指点一下
There are several ways doing it.
1) you may pass the coefs to a set of macro variables via a data step call symput and you can refer to/use them in later stages.
2) proc score after the coefs are save into a dataset. Here is the reference of proc score

Overview: SCORE ProcedureThe SCORE procedure multiplies values from two SAS data sets, one containing coefficients (for example, factor-scoring coefficients or regression coefficients) and the other containing raw data to be scored using the coefficients from the first data set. The result of this multiplication is a SAS data set containing linear combinations of the coefficients and the raw data values.
Many statistical procedures output coefficients that PROC SCORE can apply to raw data to produce scores. The new score variable is formed as a linear combination of raw data and scoring coefficients. For each observation in the raw data set, PROC SCORE multiplies the value of a variable in the raw data set by the matching scoring coefficient from the data set of scoring coefficients. This multiplication process is repeated for each variable in the VAR statement. The resulting products are then summed to produce the value of the new score variable. This entire process is repeated for each observation in the raw data set. In other words, PROC SCORE cross multiplies part of one data set with another.


3) you may use a trick to define a weight and score a data set within a regression procedure.


Which way to use depends on your case in practice.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2010-10-19 19:26:26
谢谢。。 2# bobguy
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群