广义线性模型上机实验报告
朱帅(1100719030);杨开云(1100719015)
实验背景:当相应变量不服从常值方差的正态分布时,一般线性回归模型的回归效果往往很差,解决这类问题的方法有很多种,基于广义线性模型的回归分析是一种行之有效的方法。广义线性模型是线性和非线性回归模型的一种整合,但响应变量必须是指数族中的一种,因而广义线性模型可以看作是经验模型和数据分析等当面的一种有效的处理方法。
实验目的:用logistic模型作二元响应变量的回归。
相关实例:下面是商品打折与购买人数变化的数据,我们用spss软件通过logistic模型拟合这批数据并作响应分析。
Cell Counts and Residuals
Number
打折
样本
购买人数
1
500
100
2
500
122
3
500
147
4
500
176
5
500
211
6
500
244
7
500
277
8
500
310
9
500
343
10
500
372
11
500
391
我们作打折和购买人数的的散点图(如下),很明显这并非是一个简单的线性关系,而且相应变量是二项分布,并非正态分布,故我们选择logistic回归。
用spss得到回归结果如下回归方程为:
Parameter Estimates
Parameter
Estimate
Std. Error
Z
Sig.
95% Confidence Interval
Lower Bound
Upper Bound
LOGITa
打折
.136
.005
.000
.126
.145
Intercept
-
.080
-
.000
-
-
a. LOGIT model: LOG(p/(1-p)) = Intercept + BX
yi=11+e—+
Chi-Square Tests
Chi-Square
dfa
Sig.
LOGIT
Pearson Goodness-of-Fit Test
.294
9
a. Statistics based on individual cases differ from statistics based on aggregated cases.
b. Since the significance level is greater than .150, no heterogeneity factor is used in the calculation of confidence limits.
从上述结果可以看出,λβ=, n-p=9,模型通过检验,故拟合模型是充分的。
预测表如下:
Confidence Limits
Probability
95% Co
朱帅广义线性模型上机实验报告 来自淘豆网m.daumloan.com转载请标明出处.