Displaying 2 results from an estimated 2 matches for "mavgres".
1999 Mar 02
1
Can't understand error message :-{
...residuals from a linear model against another variable in the data frame.
Here are the lines I'm trying to execute:
size <- read.table(file="/u67/abasl70/surveys/annenberg/mega/smschl.dat",
header=T)
sizef <- data.frame(size, row.names=size$unit)
attach(sizef)
mschmod <- lm (mavgres ~ crimesch + socstat + povnojob + ploinc94 + aa94 +
hisp94 + minty94 + mixed94, data=sizef)
plot(mschmod$residuals ~ size94)
The last line gives this error message:
Error in model.frame(formula, rownames, variables, varnames, extras,
extranames, : variable lengths differ
In fact, the lengths are...
2000 Mar 27
1
Behavior different inside function?
...it=" ", fm=" ") {
dsn <- paste(fn, sesnum, ".dat", sep="", collapse=NULL)
psn <- paste(fn, sesnum, ".ps", sep="", collapse=NULL)
fm1 <- as.formula(fm)
ds <- read.table(file=dsn, header=T)
rownames(ds) <- ds$unit
nmavgres <- ds$mavgres * 1000
nravgres <- ds$ravgres * 1000
ds.mrpt <- rpart(formula=fm1, data=ds, control=rpart.control(minbucket=20))
plot(prune(ds.mrpt, cp=0.018))
text(prune(ds.mrpt, cp=0.018), digits=2)
wait()
plotcp(ds.mrpt)
wait()
post.rpart(prune(ds.mrpt, cp=0.018),...