stats.R

library(ggplot2)

F=read.csv("PLOSONE2013Data.csv")
CY=(F$CYNewWorldOrder+F$CYMLK+F$CYMoon+F$CYJFK+F$CY911+F$CYDiana)/6
CLIM=(F$CNatFluct+F$CdueGHG+F$CseriousDamage+F$CO2causesCC+F$HumansInsign)/5
LGO13=data.frame(cbind(CLIM,CY))

CY3Flag=(F$CYNewWorldOrder==3)&(F$CYMLK==3)&(F$CYMoon==3)&(F$CYJFK==3)&(F$CY911==3)&(F$CYDiana==3)
CLIM3Flag=(F$CNatFluct==3)&(F$CdueGHG==3)&(F$CseriousDamage==3)&(F$CO2causesCC==3)&(F$HumansInsign==3)
All3Flag=PCY3Flag&PCLIM3Flag
CY=CY[!All3Flag]
CLIM=CLIM[!All3Flag]
LGO13tr=data.frame(cbind(CLIM,CY))

F=read.csv("LskyetalPsychSciClimate.csv")
CY=(F$CYNewWorldOrder+F$CYSARS+F$CYPearlHarbor+F$CYMLK+F$CYMoon+F$CYJFK+F$CY911+F$CYDiana+F$CYOkla+F$CYCoke+F$CYArea51+F$CYRoswell)/12
CLIM=(F$CO2TempUp+F$CO2AtmosUp+F$CO2WillNegChange+F$CO2HasNegChange+F$CauseCO2)/5
LOG13=data.frame(cbind(CLIM,CY))

CLIM=CLIM[CY<=2.5]
CY=CY[CY<=2.5]
LOG13tr=data.frame(cbind(CLIM,CY))

print("LOG13-blogs")
fit1=lm(LOG13$CLIM~LOG13$CY)
print(summary(fit1)$coefficients)
print(confint(fit1))
print(sprintf("adj r2=%f",summary(fit1)$adj.r.squared))

print("LGO13-panel")
fit2=lm(LGO13$CLIM~LGO13$CY)
print(summary(fit2)$coefficients)
print(confint(fit2))
print(sprintf("adj r2=%f",summary(fit2)$adj.r.squared))

print("LGO13-panel without satisficers")
fit3=lm(LGO13tr$CLIM~LGO13tr$CY)
print(summary(fit3)$coefficients)
print(confint(fit3))
print(sprintf("adj r2=%f",summary(fit3)$adj.r.squared))

Back to list of R-files

Advertisements