sas系统和数据分析逐步回归分析(编辑修改稿)内容摘要:
Bounds on condition number: 1, 1 Step 2 Variable AGE Entered Rsquare = C(p) = DF Sum of Squares Mean Square F ProbF Regression 2 Error 28 Total 30 Parameter Standard Type II Variable Estimate Error Sum of Squares F ProbF INTERCEP AGE RUNTIME Bounds on condition number: , Step 3 Variable RUNPULSE Entered Rsquare = C(p) = DF Sum of Squares Mean Square F ProbF Regression 3 Error 27 Total 30 Parameter Standard Type II Variable Estimate Error Sum of Squares F ProbF INTERCEP AGE RUNPULSE RUNTIME Bounds on condition number: , Step 4 Variable MAXPULSE Entered Rsquare = C(p) = DF Sum of Squares Mean Square F ProbF Regression 4 Error 26 Total 30 Parameter Standard Type II Variable Estimate Error Sum of Squares F ProbF INTERCEP AGE MAXPULSE RUNPULSE RUNTIME Bounds on condition number: , All variables left in the model are significant at the level. No other variable met the significance level for entry into the model. Summary of Stepwise Procedure for Dependent Variable OXYGEN faf3e80a2379c5288629d4555eb92a18 商务数据分析 电子商务系列 上海财经大学经济信息管理系 IS/SHUFE Page 10 of 25 如果按 CP值选择最优子集,随 着进入回归模型中的自变量个数 P 从 2 增加 到 5 个(包括截距),相应 CP 值从大到小为 、 、 和 ,按照Mallows 提出的回归模型最优自变量个数的选择准则, CP= 是最接近自变量个数P=5 的模型。 CP 的计算公式见 式 (),当 P=5 时, CP=- (31- 25)=。 因此,用逐步回归方法及 CP 值确认的拟合回归模型为: oxygen= - + - - 条件指数( condition number)为最大特征值和每个特征值之比的平方根。 我们看到 , 当模型进入第四个自变量 maxpulse 时,最大的条件指数从较小 的 变成了较大 的,说明存在一定程度的共线性,根据前面例 的分析,我们诊断这个共线性方程可能为 runpulse- maxpulse=0。 在向前、向后或逐步回归的变量选择过程中,都 有一个判断是否可进入或剔除的显著水平,在程序中是分别由 model语句的选项 slentry=和 slstay=设定的,缺省的情况见表。 表 缺省的入选和剔除 显著水平 forward backward stepwize slentry slstay 下面我们提供全部可能回归的程序,并且以 R2 值 由 大到小 的 排序输出。 proc reg data= fitness。 model oxygen = age weight rstpulse maxpulse runpulse runtime /selection= rsquare b。 run。 在上述程序中, model语句的选项 selection= rsquare,表示请求 R2值最大法,选项 b 是表示要输出每种回归的回归系数。 程序运行后,得到 如 表 所示的结果。 表 用 R2排序全部可能的变量数的 逐步 回归分析结果 faf3e80a2379c5288629d4555eb92a18 商务数据分析 电子商务系列 上海财经大学经济信息管理系 IS/SHUFE Page 11 of 25 程序的输出包括所有只含一个变量的 6 种回归,含 2 个变量的 15 种回归„„ 总共有 63种不同形式的回归模型。 例如,含 2 个自变量按 R2 第二个大值选择回归模型为, R2 =,拟合的回归模型为 : oxygen= - - 若对每种变量个数,只要保留 R2 最大的两种情况,可在 model语句中加入选项 best=2,即提交以下的程序: proc reg data= fitness。 model oxygen = age weight rstpulse maxpulse runpulse runtime /selection= rsquare b best=2。 run。 这一程序提供较为紧凑的输出报表, 如 表 所示的结果。 表 只保留 R2最大两种情况的逐步 回归分析结果 N = 31 Regression Models for Dependent Variable: OXYGEN Parameter Number in Rsquare Estimates Model Intercept AGE WEIGHT RSTPULSE MAXPULSE RUNPULSE RUNTIME 1 . . . . . 1 . . . . . 1 . . . . . 1 . . . . . 1 . . . . . 1 . . . . . 2 . . . . 2 . . . . 2 . . . . „„ „„ „„ „„ 5 . 5 . 6 faf3e80a2379c5288629d4555eb92a18 商务数据分析 电子商务系列 上海财经大学经济信息管理系 IS/SHUFE Page 12 of 25 通过上面的逐步回归分析,我们已经得到回归模型的自变量个数确定时的最优子集 或次优子集,但问题是我们到底应该选择几个自变量的回归模型呢。 如 表 中的 3个自变量、4 个自变量、 5。sas系统和数据分析逐步回归分析(编辑修改稿)
相关推荐
性。 为了便于比较,我们将原始时间序列和消除增幅后的时间序列按 12 个时间单位的间隔绘制在一张图表上。 程序如下: data arimad02。 set arimad01。 xlog=log(x)。 proc print data=arimad02。 run。 proc gplot data=arimad02。 plot xlog*date / vaxis=axis1 haxis=axis2
select * from B。 quit。 A UNION B x y 1 one 2 two 3 three 4 four 产生只属于第一个查询的观测 (EXCEPT算符 ) proc sql。 title 39。 A EXCEPT B39。 select * from A except select * from B。 quit。 A EXCEPT B x y 3 three
范围内的观测 Where x between 1 and 5。 where 1=x=5。 例 不能用 WHERE语句的情况 data a。 set。 where _n_100。 /*错误语句,必须用 if */ run。 data a。 set。 if _n_100。 run。 例中,不能用 WHERE语句控制 SAS的自动变量。 OUTPUT语句
可变类平均法。 大多数的研究表明:最好综合特性的聚类方法为类平均法或 Ward 最小方差法,而最差的则为最短距离法。 Ward 最小方差法倾向于寻找观察数相同的类。 类平均法偏向寻找等方差的类。 具有最小偏差的聚类方法为最短距离法和密度估计法。 拉长的或无规则的类使用最短距离法比其他方法好。 最没有偏见的聚类方法为密度估计法。 五、 SAS 的聚类分析过程 SAS 的聚类过程能够被用来对某个
1121*)1()1(nsnsntnsntnst () 用上面修正后的 *t 统计量作出合适的统计推断。 一般地, Chchran 和 Cox检验趋于保守。 另外, Satterthwaite( 1864)就设法用 t 统计量去拟合,结果发现若取: )1()1(/) 22242121412222121nn snn snsnsl ()
Model 1 Error 198 C Total 199 Root MSE Rsquare Dep Mean Adj Rsq . Parameter Estimates Parameter Standard T for H0: Variable DF Estimate Error Parameter=0 Prob |T| INTERCEP 1 WEIGHT 1 上海财经大学经济信息管理系