Why does the following not work? by(warpbreaks, warpbreaks$tension, function(x) add1(lm(breaks ~ 1, data=x), ~ . + wool)) Error in inherits(x, "data.frame") : Object "x" not found Is there another efficient way to apply add1() to subsets of a data frame? Thanks. -- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 452-1424 (M, W, F) fax: (917) 438-0894