[R] Plotting Confidence Intervals

Kehl Dániel kehld at ktk.pte.hu
Sat May 2 10:24:42 CEST 2015


Hi Andre,

I think you'll have to give some more information about what you want to see on your plot. The 4 intervals with labels? A bar with an interval maybe? Four bars with the intervals? Only two showing differences between conf and pred intervals?

Also you do miss a 1 here I guess:

p_conf1<- predict(ines,interval="confidence",NJ,level=0.99)
p_conf1 #Intervalo de confiança para o estado NJ e para um nivel de 99%
round(p_conf, digits=3)

last line should read p_conf1 here?

Best,
d
________________________________________
Feladó: R-help [r-help-bounces at r-project.org] ; meghatalmazó: Andre Roldao [andre.rafael.roldao at gmail.com]
Küldve: 2015. május 2. 4:49
To: r-help at r-project.org
Tárgy: [R] Plotting Confidence Intervals

Hi Guys,

It's the first time i use R-Help and i hope you can help me.

How can i plot conffidence intervals? with the data bellow:

#Package Austria
library(car)
#head(States)
States1=data.frame(States)

ines=lm(SATM ~ log2(pop) + SATV , data=States1)
summary(ines)

NJ=as.data.frame(States["NJ",c(4,2,3)]) #Identificação do estado NJ


p_conf<- predict(ines,interval="confidence",NJ,level=0.95)
p_conf #Intervalo de confiança para o estado NJ e para um nivel de 95%
round(p_conf, digits=3)

p_conf1<- predict(ines,interval="confidence",NJ,level=0.99)
p_conf1 #Intervalo de confiança para o estado NJ e para um nivel de 99%
round(p_conf, digits=3)

p_pred2<- predict(ines,interval="prediction",NJ,level=0.95)
p_pred2 #Intervalo de perdição para o estado NJ e para um nivel de 95%
round(p_pred2,digits=3)

p_pred3<- predict(ines,interval="prediction",NJ,level=0.99)
p_pred3 #Intervalo de perdição para o estado NJ e para um nivel de 99%
round(p_pred3,digits=3)

Thanks

        [[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list