您好,欢迎访问三七文档
当前位置:首页 > 医学/心理学 > 医学试题/课件 > 多元Logistic回归
MultinomialLogisticRegression一、概述当因变量为分类变量,并且分类数大于2时,进行回归分析时,可使用该模型。数学模型:以Y分三类情形为例。假定因变量Y为分类变量,类数为3,各类之间无顺序之分,且假定Y的取值分别为a、b、c,选Y=a为b和c的共同参照组,则有以下模型:如果希望比较b和c两组,则直接将上述两方程相减即可得到相应函数。ppbxxaYPbYP1111lnppcxxaYPcYP2121ln例题:研究不同学校和不同课程计划对学生学习方式偏好的影响,得到数据如下表。试进行logistic回归分析。学校school课程计划program学生偏好的学习方式自修小组上课1常规101726附加512502常规211726附加1612363常规151516附加1212201.建立数据文件SPSS的基本操作2.对数据进行加权:Data→Weightcased选择“WeightCasedby:”将变量“count”选入“FrequencyVariable”框OK3.Analyze→Regression→MultinomialLogistic打开MultinomialLogisticRegression对话框:4.将变量“style”选入“Dependent”框中5.将变量“school”和“program”选入“Factor”框OK(其他选项均取默认值)输出结果及解释CaseProcessingSummary7924.1%8525.9%16450.0%12036.6%11836.0%9027.4%16349.7%16550.3%328100.0%03286自修小组上课偏好学习方式123学校常规附加课程计划ValidMissingTotalSubpopulationNMarginalPercentage该表为总模型的似然比检验结果,可见最终模型和只含有常数项的初始模型相比,-2LL值从78.128下降至51.303,下降了26.825,似然比卡方检验的P-值小于0.01,说明模型整体是显著的。ModelFittingInformation78.12851.30326.8256.000ModelInterceptOnlyFinal-2LogLikelihoodChi-SquaredfSig.类R2指标,此处因只有分类变量,所以三个决定系数都非常低,不过在Logistic模型分析中它们的用处不太大。PseudoR-Square.079.090.039CoxandSnellNagelkerkeMcFadden似然比检验该表结果表明,在5%的显著水平下,“XCHOOL”和“PROGRAM”两个变量的作用都是显著的。LikelihoodRatioTests51.303a.0000.69.19217.8884.00158.9167.6132.022EffectInterceptSCHOOLPROGRAM-2LogLikelihoodofReducedModelChi-SquaredfSig.Thechi-squarestatisticisthedifferencein-2log-likelihoodsbetweenthefinalmodelandareducedmodel.Thereducedmodelisformedbyomittinganeffectfromthefinalmodel.Thenullhypothesisisthatallparametersofthateffectare0.Thisreducedmodelisequivalenttothefinalmodelbecauseomittingtheeffectdoesnotincreasethedegreesoffreedom.a.其中:school=3和program=2为参照,因此其参数为0。ParameterEstimates-.593.2954.0401.044-1.314.38311.7831.001.269.127.569-.076.336.0521.820.926.4791.7910b..0.....618.2854.7021.0301.8551.0613.2440b..0....-.603.2924.2511.039-.654.3383.7371.053.520.2681.009-.321.347.8521.356.726.3671.4340b..0.....635.2735.4171.0201.8871.1053.2210b..0....Intercept[SCHOOL=1][SCHOOL=2][SCHOOL=3][PROGRAM=1][PROGRAM=2]Intercept[SCHOOL=1][SCHOOL=2][SCHOOL=3][PROGRAM=1][PROGRAM=2]偏好学习方式a自修小组BStd.ErrorWalddfSig.Exp(B)LowerBoundUpperBound95%ConfidenceIntervalforExp(B)Thereferencecategoryis:上课.a.Thisparameterissettozerobecauseitisredundant.b.0.5931.13410.07620.6180.6030.65410.32120.635pLnschoolschoolprogramppLnschoolschoolprogramp自修上课小组上课各回归系数显著性检验ParameterEstimates-.593.2954.0401.044-1.314.38311.7831.001.269.127.569-.076.336.0521.820.926.4791.7910b..0.....618.2854.7021.0301.8551.0613.2440b..0....-.603.2924.2511.039-.654.3383.7371.053.520.2681.009-.321.347.8521.356.726.3671.4340b..0.....635.2735.4171.0201.8871.1053.2210b..0....Intercept[SCHOOL=1][SCHOOL=2][SCHOOL=3][PROGRAM=1][PROGRAM=2]Intercept[SCHOOL=1][SCHOOL=2][SCHOOL=3][PROGRAM=1][PROGRAM=2]偏好学习方式a自修小组BStd.ErrorWalddfSig.Exp(B)LowerBoundUpperBound95%ConfidenceIntervalforExp(B)Thereferencecategoryis:上课.a.Thisparameterissettozerobecauseitisredundant.b.变量“school1”回归系数为负值,显著不为零,表明:自修与上课两种学习方式相比,学校1的学生比学校3的学生更容易选择上课学校2与学校3的学生的选择则没什么差别。常规学习计划的学生比附加学习计划的学生更容易选择自修学习方式。ParameterEstimates-.593.2954.0401.044-1.314.38311.7831.001.269.127.569-.076.336.0521.820.926.4791.7910b..0.....618.2854.7021.0301.8551.0613.2440b..0....-.603.2924.2511.039-.654.3383.7371.053.520.2681.009-.321.347.8521.356.726.3671.4340b..0.....635.2735.4171.0201.8871.1053.2210b..0....Intercept[SCHOOL=1][SCHOOL=2][SCHOOL=3][PROGRAM=1][PROGRAM=2]Intercept[SCHOOL=1][SCHOOL=2][SCHOOL=3][PROGRAM=1][PROGRAM=2]偏好学习方式a自修小组BStd.ErrorWalddfSig.Exp(B)LowerBoundUpperBound95%ConfidenceIntervalforExp(B)Thereferencecategoryis:上课.a.Thisparameterissettozerobecauseitisredundant.b.0.5931.13410.07620.618pLnschoolschoolprogramp自修上课模型结果的解释结束
本文标题:多元Logistic回归
链接地址:https://www.777doc.com/doc-3366743 .html