[R] how to fit model to split data and get residual plots

From: Eduardo S. G. Mizubuti <mizubuti_at_ufv.br>
Date: Tue, 15 Jan 2008 17:25:15 -0200

I have a data set with the following structure (with many more obs.):

var1 	expt 	day 	diameter
1	1	2	0.5
1	1	3	0.9
1	1	4	1.3
1	1	5	1.7
1	2	2	0.3
1	2	3	0.5
1	2	4	0.9
1	2	5	1.6
2	1	2	0.7
2	1	3	1.2
2	1	4	1.6
2	1	5	2.3
2	2	2	0.4
2	2	3	0.8
2	2	4	1.6
2	2	5	3.2

I can get separate regression analysis for each level of var1 and expt with the command:

by(data3, data3$var1:data3$expt, function(x) lm(diameter ~ day, data = x))

How can I get residual plots for each combination var1*expt generated above?

Thanks!
Eduardo

-- 
Eduardo S. G. Mizubuti
Departamento de Fitopatologia
Universidade Federal de Višosa
36570-000 Višosa, MG Brasil
tel.: +55 31 3899 1090
fax: +55 31 3899 2240
e-mail: mizubuti_at_ufv.br

______________________________________________
R-help_at_r-project.org mailing list
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.
Received on Tue 15 Jan 2008 - 19:31:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Jan 2008 - 20:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive