Displaying 2 results from an estimated 2 matches for "wintemp".
2001 Mar 20
3
Newbie question about by() -- update
...lack of detail. I am running R v.1.2.2. I can recast my
question
(which I think I have partially answered) more succinctly as follows:
1. This seems to work (note that group takes values 1,2,3,4, or 5):
my.newfun <- function(x) myfile <- lm(award ~ ilogemp + ilogage, x)
test.by <- by(wintemp, as.factor(wintemp$group), my.newfun)
2. This does not work (leaving aside whether I am using ppr correctly or not!):
> my.pprfun <- function(x) mypprfile <- ppr(award ~ ilogemp + ilogage, data = x, nterms = 5,
+ max.terms = 10, optlevel = 3)
> test.by <- by(wintemp...
2001 Mar 16
1
Newbie question about by()
Dear R list:
I want to make separate estimates for each level of the variable "group."
After consulting many sources I am stumped as to why the following does not work:
> wintemp <- subset(alltemp, winner==1)
> my.ppr <- function(x)
+ {
+ if(nrow(x) >= 50) {
+ pprfile <- ppr(award~ilogemp, data=x,nterms=5,max.terms=10,optlevel=3)
+ summary(pprfile)
+ }
+ }
> test.by <- by(wintemp,as.factor(wintemp$group),my.ppr)
Error in model.frame....