Professional Documents
Culture Documents
Escriba 'demo()' para demostraciones, 'help()' para el sistema on-line de ayuda, o 'help.start()' para
abrir el sistema de ayuda HTML con su navegador. Escriba 'q()' para salir de R.
Partial correlations:
DBH D16 HT
DBH 0.00000 0.93858 0.74529
D16 0.93858 0.00000 -0.57308
HT 0.74529 -0.57308 0.00000
Number of observations: 12
> fit=lm(DBH~D16+HT)
> sfit=summary(fit )
> sfit
Call:
lm(formula = DBH ~ D16 + HT)
Residuals:
Min 1Q Median 3Q Max
-1.2065 -0.5262 -0.1497 0.5443 1.4465
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.33732 0.56736 0.595 0.56679
D16 0.48108 0.05895 8.160 1.89e-05 ***
HT 0.28865 0.08608 3.353 0.00848 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> confint(fit )
2.5 % 97.5 % ( Intercept ) -
0.94613861 1.6207785
D16 0.34771091 0.6144411
HT 0.09393154 0.4833739
> cv=100*(0.8597/mean(DBH ))
> cv
[1] 13.05873
> par(mfrow=c(2,2))
> plot(fit )
> e<-residuals(fit )
> d<-e/sfit$sigma
> hist(d,probability=T,xlab="Residuos estandarizados",main="",xlim =c(-3,3))
> d.seq<-seq(-3,3,length=50)
> lines(d.seq,dnorm(d.seq,mean(d),sd(d))) > shapiro.test(e)
data: e
W = 0.97028, p-value = 0.9137
> library(lmtest )
Loading required package: zoo
as.Date, as.Date.numeric
data: fit
BP = 2.771, df = 2, p-value = 0.2502
> n<-length(d)
> plot(d[1:(n-1)],d[2:n],xlab="Residuo i",ylab="Residuo i-1" )
> lines(lowess(d[1:(n-1)],d[2:n]),col="red")
> library(lmtest)
> dwtest(fit,alternative="two.sided") Durbin-Watson
test
data: fit
DW = 1.9561, p-value = 0.7617
alternative hypothesis: true autocorrelation is not 0.