利用逻辑斯回归分析.docx

上传人:b****6 文档编号:3285706 上传时间:2022-11-21 格式:DOCX 页数:8 大小:24.99KB
下载 相关 举报
利用逻辑斯回归分析.docx_第1页
第1页 / 共8页
利用逻辑斯回归分析.docx_第2页
第2页 / 共8页
利用逻辑斯回归分析.docx_第3页
第3页 / 共8页
利用逻辑斯回归分析.docx_第4页
第4页 / 共8页
利用逻辑斯回归分析.docx_第5页
第5页 / 共8页
点击查看更多>>
下载资源
资源描述

利用逻辑斯回归分析.docx

《利用逻辑斯回归分析.docx》由会员分享,可在线阅读,更多相关《利用逻辑斯回归分析.docx(8页珍藏版)》请在冰豆网上搜索。

利用逻辑斯回归分析.docx

利用逻辑斯回归分析

利用逻辑斯回归分析

第12週講義(12-1)

利用邏輯斯迴歸分析(LogisticRegressionAnalysis)作分類分析

BinaryResponsewithoneexplanatoryvariable:

:

ResponseofthethsamplingunitiYi

=Y0or1i

:

predictor(explanatoryvariable)forthethsamplingunitiXi

,,xeP=P(Y=1|x)=x,,,x1,e

Px,,,xloglogitP==x1,Px

,,,x若令P=P(Y=0|x),則logitP=。

xx

,,xeP(y=1|x)=之圖形,,,x1,e

,0,,,1,,0,,,,1

估計法:

最大概似估計量或加權最小平方法。

對X=x有n個中c個反應變數為1。

iii

:

A:

最大概似估計法

kn,,n,ciciii,,,,概似函數p1,p,xx,,iic1i,,i,

c,nci,,,xiikin,,,,e1,,i,,,,=,,,L,,,,,,,,,,,,xx,,,,iic1e1e,,,,,1i,i,,,

,,找出使得以上之機率為最大。

:

B:

WeightedLSE(leastsquareestimator)

cciin,,

(1)np(1,p)c之Var(c)=用來估計iiiixxiinnii

1給予權數:

加權數,加重數:

Varci

第12週講義(12-2)

BinaryResponsewithseveralexplanatoryvariables:

1,:

theresponseofthindividual,binaryresponsei,YY,ii0,

:

p–dimvectorofcovariateXX,(X,X,...,X)ii1i2ipi~~

P,P(Y,1|X)iii~

LogisticRegressionmodel

,,logitP,,X,...,X011iippi

PlogitP,log1,P

,,,,...,XX011ippiei.e.P,i,,,,...,,XX011ippi1,e

,logitP(Y,1|X,r,1),logitP(Y,1|X,r)iiiii

P(Y,1|X,r,1)/P(Y,0|X,r,1)iiii,lnP(Y,1|X,r)/P(Y,0|X,r)iiii

:

logoddsratiocorrespondingtoaunitchangeinpredictorwhenallotherareX,Xjii

holdconstants.

,,2,G:

H:

,...,,0(model0)p012,,,

H:

logitP,,X,...,Xiippi1011

maxLikelihoodLH00LR,,,,2logLR,,2(logL,logL),,2logL,2logLmm00maxLikelihoodLm,,22G,,2ln(LR)~p

故其值其值,以表示所選擇變數之相關重要性

,,2,D:

(deviance)H:

logitP,,X,...,Xpp0011

H:

saturatedmodel(models)1

2logLR,,2logL,2logLsm

22,D,,2ln(LR)~,,np1

故其值其值,表示fit好

22G,D,2logL,2logLs0

H:

logitP,,0022,,G,D,constant,之,2ln(LR),H:

saturated1,

第12週講義(12-3)

LogisticRegressionwithOneContinuousCovariate

TheSASSystem程式:

TheLOGISTICProcedureoptionsnodatenonotes;DataSet:

WORK.P261datap261;

ResponseVariable(Events):

CResponseProfileinputloadnc;r=c/n;ResponseVariable(Trials):

NOrderedBinarycards;NumberofObservations:

10ValueOutcomeCount25005010LinkFunction:

Logit1EVENT33727007017

2NOEVENT353290010030ModelFittingInformationandTesting31006021

GlobalNullHypothesisBETA=033004018Intercept35008543

Interceptand37009054CriterionOnlyCovariatesChi-SquareforCovariates39005033AIC958.172847.712.41008060SC962.709856.785.43006551

-2LOGL956.172843.712112.460with1DF(p=0.0001);Score..107.066with1DF(p=0.0001)proclogistic;

modelc/n=load;AnalysisofMaximumLikelihoodEstimatesoutputout=a

ParameterStandardWaldPr>pred=pred;VariableDFEstimateErrorChi-SquareChi-Squarerun;INTERCPT1-5.33970.545795.75000.0001..procprint;LOAD10.001550.00015896.60850.0001run;

OddsRatioEstimates

Point95%Wald

EffectEstimateConfidenceLimits

load1.0021.0011.002

AssociationofPredictedProbabilitiesandObservedResponses

PercentConcordant68.0Somers'D0.452

PercentDiscordant22.9Gamma0.497

PercentTied9.1Tau-a0.226

Pairs118961c0.726

AssociationofPredictedProbabilitiesandObservedResponses

Concordant=68.0%Somers'D=0.452

Discordant=22.9%Gamma=0.497

Tied=9.1%Tau-a=0.226

(118961pairs)c=0.726

OBSLOADNCRPRED

1250050100.200000.18715

2270070170.242860.23886

32900100300.300000.29959

4310060210.350000.36829

5330040180.450000.44278

6350085430.505880.51994

7370090540.600000.59616

8390050330.660000.66801

9410080600.750000.73280

10430065510.784620.78894

第12週講義(12-4)

LogisticRegressionwithMixedCovariate

Datacrab;

inputcolorspinewidthsatellweight;

ifsatell>0theny=1;ifsatell=0theny=0;n=1;

weight=weight/1000;color=color-1;

cards;

3328.383050

4322.501550

2126.092300

.

..

5327.002625

3224.502000

;

procgenmod;classcolor;

modely/n=colorwidth/dist=binlink=logit;

proclogistic;

modely=colorweightwidth/selection=backward;

run;

PARTOFOUTPUT:

TheGENMODProcedure

ModelInformation

DataSetWORK.CRAB

DistributionBinomial

LinkFunctionLogit

ResponseVariable(Events)y

ResponseVariable(Trials)n

ObservationsUsed173

NumberOfEvents111

NumberOfTrials173

ClassLevelInformation

ClassLevelsValues

color41234

CriteriaForAssessingGoodnessOfFit

CriterionDFValueValue/DF

Deviance168187.45701.1158

ScaledDeviance168187.45701.1158

PearsonChi-Square168168.65901.0039

ScaledPearsonX2168168.65901.0039

LogLikelihood-93.7285

Algorithmconverged.

AnalysisOfParameterEstimates

StandardWald95%ConfidenceChi-ParameterDFEstimateErrorLimitsSquarePr>ChiSq

Intercept1-12.71512.7618-18.1281-7.302121.20<.0001

color111.32990.8525-0.34103.00082.430.1188

color211.40230.54840.32742.47736.540.0106

color311.10610.5921-0.05432.26663.490.0617

color400.00000.00000.00000.0000..width10.46800.10550.26110.674819.66<.0001

Scale01.00000.00001.00001.0000NOTE:

Thescaleparameterwasheldfixed.

第12週講義(12-5)

TheLOGISTICProcedure

ModelInformation

DataSetWORK.CRAB

ResponseVariabley

NumberofResponseLevels2

NumberofObservations173

Modelbinarylogit

OptimizationTechniqueFisher'sscoring

ResponseProfile

OrderedTotal

ValueyFrequency

1062

21111

Probabilitymodeledisy=0.

BackwardEliminationProcedure

Step0.Thefollowingeffectswereentered:

Interceptcolorweightwidth

ModelConvergenceStatus

Convergencecriterion(GCONV=1E-8)satisfied.

ModelFitStatistics

Intercept

Interceptand

CriterionOnlyCovariates

AIC227.759195.925

SC230.912208.538

-2LogL225.759187.925

TestingGlobalNullHypothesis:

BETA=0

TestChi-SquareDFPr>ChiSq

LikelihoodRatio37.83363<.0001

Score33.38873<.0001

Wald27.88553<.0001

第12週講義(12-6)

TheLOGISTICProcedure

Step1.Effectweightisremoved:

ModelFitStatistics

Intercept

Interceptand

CriterionOnlyCovariates

AIC227.759195.121

SC230.912204.581

-2LogL225.759189.121

TestingGlobalNullHypothesis:

BETA=0

TestChi-SquareDFPr>ChiSq

LikelihoodRatio36.63732<.0001

Score32.73582<.0001

Wald27.06092<.0001

ResidualChi-SquareTest

Chi-SquareDFPr>ChiSq

1.203110.2727

NOTE:

No(additional)effectsmetthe0.05significancelevelforremovalfromthemodel.

SummaryofBackwardElimination

EffectNumberWald

StepRemovedDFInChi-SquarePr>ChiSq

1weight121.17780.2778

TheLOGISTICProcedure

AnalysisofMaximumLikelihoodEstimates

StandardWald

ParameterDFEstimateErrorChi-SquarePr>ChiSq

Intercept110.07082.806912.87330.0003

color10.50900.22375.17910.0229

width1-0.45830.104019.4129<.0001

OddsRatioEstimates

Point95%Wald

EffectEstimateConfidenceLimits

color1.6641.0732.579

width0.6320.5160.775

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 小学教育 > 语文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1