Sie sind auf Seite 1von 6

LinearRegressionProject

AninvestigationintotherelationshipbetweenacountryslifeexpectancyandtheirGDPper
capita.Thedatawasfirsttestedforalinearregression,butalogarithmicrelationshipwasfound
tobethebestfittingmodel.

EmilyHeubaum
Project2LinearRegression
KikerPd3
GDPperCapita&LifeExpectancyRegressionAnalysis

IchosethevariablesofGDPperCapitaandLifeExpectancyatBirth.Ichose15data
points,allfromthePacificregion.Ichosethesevariablesandmorespecificallythesedatapoints
becauseIwanttogointoforeignrelationsoneday(specificallyinthePanPacificregion),andit
isimportanttoanalyzetherelationshipsbetweendifferentmeasuresofdevelopmentinacountry.
OnceIgointoforeignrelations,itwillbeimportantthatIunderstandhowtoanalyzethesedata
sets.
TheGDPperCapitavariableshouldexplainthelifeexpectancyvariable,asricher
nationscitizenstendtolivelongerbecausetheygenerallyhavebetterhealthcare.Butthisisa
cyclicalprocess,asthelongeryoulivehealthilythelongeryoucanworkandmakemoremoney,
raisingtheGDPperCapita.Forthisanalysis,GDPperCapitaistheexplanatoryvariable,and
LifeExpectancyatbirthistheresponsevariable.
Thescatterplotsgenerated,aswellastheresidualplot,appearedlikethis:

Theyinterceptwas69.3years,ther^2valuewas.66,thervaluewas.81andtheslope
was.00024.ThismeansthatifacountrysGDPperCapitawassomehowzero,theircitizens
LifeExpectancywouldbe69.3years.ForeveryoneunitGDPperCapitaincreases,theLife
Expectancygoesupby.00024years.Ther^2valueof.66showsthat66%ofthevariationin
LifeExpectancycanbeattributedtovariationinGDPperCapita.Thervalueshowsthatthese
variableshaveamoderate,strong,positivecorrelation.
Theleastsquaresregressionequationwas=69.3+.00024x,or
(LifeExpectancyHat)=69.3+.00024GDP.AproblematicdatapointappearedtobeAustralia,
whoselifeexpectancywasfarbelowthepredictedvalue,butaftertheremovalofthispoint,ther
andr^2valueschangednegligiblyandevengotweaker,soAustraliastayedinthedataset.There
wereotherwisenoextremeoutliersorinfluentialpointsinthisdataset.
Theresidualplothasadefinitenegativelinearassociation,anddoesnotappeartobe
totallyrandom,sothismodelislikelynotappropriate.However,thelargestresidualwasonly
7.5,theoverpredictionforPapuaNewGuinea.
Totestthismodel,thedatapointofChinawaschosenasanexample,whoseGDPper
Capitaisapproximately$6264.6USD.Inputtedintotheleastsquareslinearregressionequation
of=69.323+.00024x,thepredictedlifeexpectancywas70.8years.Thisisan
underprediction,becausetheactuallifeexpectancyforChinawas75.2years,makingthe
residualvalue4.4.Thismayhavearelativelylowresidualandseemappropriate,butthelinear
modelhasalreadyshowntobeinappropriateforthisdataset.

Thisdataseemstobemorelogarithmicthanlinear.Toshowthis,hereisthesamedata
andalogarithmicparentfunction.

Tofurthershowitslogarithmicnature,thisiswhathappenswhenthedataispresentedon
alogarithmicscale:

Theassociationnowlooksclearerandlinear.Thisshowsalogarithmicregressionwould
likelybemuchmoreappropriatethanalinearregression.
AcareerthatwouldinvolvethiskindofdataanalysiswouldbeajobattheUnited
Nations,theHague,oranyothernationalorinternationalassociation.Analyzingdatalikethis
canhelppeopleunderstandtheworldeconomybetter,aswellastheinterconnectednessof
certainvariablesacrossborders.OnedayImaywanttopursueacareerofthatnature.

Thereisamoderatelystrong,linearpositivecorrelationbetweenthevariablesofGDPper
CapitaandLifeExpectancyatBirth.ThismeansthatastheGDPperCapitaincreases,Life
ExpectancyIncreaseswithsomedegreeofreliability.Wecannothoweverconcludethathigher
GDPperCapitacauseshigherLifeExpectancyatBirth,becausewehavefoundacorrelation,
notcausation.Thesetwovariablesareconnected,buttherecouldbelurkingvariablesthatare
moredirectlyrelated,especiallybecauseasrichernationscitizenstendtolivelongerbecause
theygenerallyhavebetterhealthcare.However,thebetterhealthcareyouhave,thelongeryou
canstayintheproductiveworkforcebeforeretirement,raisinganationsGDPperCapita.This
cyclicalnatureofmostlargescalevariablerelationshipsisimportanttostudyasourworldgets
smallerandsmaller.

CODE:
>plot(p2$GDP.per.Capita,p2$Life.Expectancy,main="LifeExpectancyvsGDPperCapita",xlab="GDPPer
Capita(US$)",ylab="LifeExpectancyatBirth(Years)")
>linFit(p2$GDP.per.Capita,p2$Life.Expectancy)
Intercept=69.32313
Slope=0.00024
Rsquared=0.6603

**ResidualPlots&NonlinearscatterplotsdoneinGoogleSheets


WORKSCITED:
"LifeExpectancyatBirth."
WorldDevelopmentIndicators
.TheWorldBank,n.d.Web.12Nov.
2015.
<
http://databank.worldbank.org/data/reports.aspx?Code=SE.ADT.LITR.ZS&id=af3ce82b
&report_name=Popular_indicators&populartype=series&ispopular=y
>.
"GDPperCapita."
WorldDevelopmentIndicators
.TheWorldBank,n.d.Web.12Nov.2015.
<
http://databank.worldbank.org/data/reports.aspx?Code=NY.GDP.PCAP.CD&id=af3ce82b
&report_name=Popular_indicators&populartype=series&ispopular=y
>.
LogarithmicFunction
.Digitalimage.
WordPress:MVNGU
.WordPress,n.d.Web.12Nov.
2015.<https://mvngu.files.wordpress.com/2008/08/06_logarithmicfunction.png>.

Das könnte Ihnen auch gefallen