Maybe I should simplify the problem with the following smaller table. And I just want to ask whether there is any significant difference in the proportion of "Good_Sample" produced by factories located in "City_A" and "City_B".
Factory_ID Factory_Location Total_Sample Good_Sample ---------------------------------------------------------------------------------------- 1 City_A 100 90 2 City_A 120 55 3 City_A 80 40 4 City_A 75 50 5 City_B 150 80 6 City_B 120 55 7 City_B 125 40 8 City_B 100 60 9 City_B 70 45 10 City_B 85 65 ---------------------------------------------------------------------------------------- On Mon, Mar 22, 2010 at 2:56 PM, Joshua Wiley <jwiley.ps...@gmail.com>wrote: > I am not completely sure what your regression model looks like (what > your outcome and predictors are). It seems like you have different > levels of data (samples nested in factories nested in cities). What > question do you really want to answer? You might consider looking > into multi-level analyses. Douglas Bates has an excellent package > "lme4" that works with nested models. Particularly check out ?glmer > for the multi-level equivalent of glm(). I don't know if that really > gets to your question of dealing with individual factory, but it is at > least designed to handle different levels. I only have a rudimentary > knowledge of multi-level models or logistic regression so I cannot > offer much advice. > > Best of luck, > > Joshua > \ > -- Xiang Gao, Ph.D. Department of Biology University of North Texas [[alternative HTML version deleted]] ______________________________________________ R-help@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.