[R-sig-eco] Ancova Plot R

Luis Fernando García luysgarcia at gmail.com
Tue Mar 17 05:38:08 CET 2015


Dear R users.

I have an urgent question to make you, hopefully you can help me.

This is my first time making an ancova test in R. I have finished the model
design and now I need to plot it. I have found several online sources where
the mechanics for plotting data is explained, nevertheless all of these
explain the mechanics for plotting the data when there is no interacion
which is not my case. I was thinking to subset the data following this
example (
http://r-eco-evo.blogspot.com/2011/08/comparing-two-regression-slopes-by.html),
but I do not know if it will be the best choice.

If some of you could suggest me a document which explains this in detail or
may be help me with the data set,

> a<-read.table ("test1ancova.txt", header=T)
> attach(a)
> names(a)
> fit3<-lm(log(Peso) ~ especie * Radio)
> summary(fit2)

Call:
lm(formula = log(Peso) ~ especie * Radio)

Residuals:
     Min       1Q   Median       3Q      Max
-1.15349 -0.29033  0.04444  0.39277  1.41267

Coefficients:
                  Estimate Std. Error t value Pr(>|t|)
(Intercept)         2.0610     0.2050  10.054 5.84e-11 ***
especieNops         1.8253     0.3002   6.080 1.28e-06 ***
Radio               0.3827     0.1414   2.707   0.0113 *
especieNops:Radio  -0.3749     0.1438  -2.608   0.0142 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.5418 on 29 degrees of freedom
Multiple R-squared:  0.7005,    Adjusted R-squared:  0.6695
F-statistic: 22.61 on 3 and 29 DF,  p-value: 9.578e-08


>  plot(a$Radio,a$Peso, type="n",xlab="Ratio", ylab="Weight")
>  points(a$Radio[1:15], a$Peso[1:15], col="red")
>  points(a$Radio[16:30], a$Peso[16:30], col="blue")

Any help will be really appreciated!

Thanks in advance
-------------- next part --------------
Radio	especie	Peso
0.33	Harpactea	3.51
0.30	Harpactea	9.20
0.32	Harpactea	6.64
0.23	Harpactea	8.32
0.31	Harpactea	10.03
0.36	Harpactea	13.35
2.23	Harpactea	7.11
0.32	Harpactea	6.69
2.04	Harpactea	17.26
1.32	Harpactea	22.75
1.85	Harpactea	20.70
2.58	Harpactea	14.55
3.11	Harpactea	42.42
0.47	Harpactea	38.61
0.13	Harpactea	5.32
19.67	Nops	87.11
1.56	Nops	71.40
5.14	Nops	54.58
5.16	Nops	78.01
3.00	Nops	44.80
4.84	Nops	53.62
2.71	Nops	64.95
3.34	Nops	83.07
3.38	Nops	76.73
5.76	Nops	47.52
7.63	Nops	16.31
14.82	Nops	81.82
3.20	Nops	36.67
10.77	Nops	26.14
10.15	Nops	41.05
3.05	Nops	52.16
4.65	Nops	30.74
13.43	Nops	58.62


More information about the R-sig-ecology mailing list