[S] Possible Statistical Enhancements to S-PLUS

Carl Schwarz (cschwarz@cs.sfu.ca)
Tue, 21 Apr 1998 13:28:43 +1200


I would like to echo a previous sender's request that some effort should be
placed into fixing up some current anomalies in SPLUS before adding new
features.

Here are my 'favorite' gripes.

1.The manova function gets upset when you try and use it with a single
variable. Why? This is useful when you are automatically generating
contrasts (e.g profile analysis) and the data just happens to have only 2
response variables and so reduces to a single manova. If a user really
wants to do a MANOVA on a single variable, why not?

e.g. here is a segment of coding that illustrates the problem

#
# 2. Test for coincidence given that they are parallel
#
con.coincidence <- matrix(nrow=1, ncol=4, byrow=T,
data = c(1, 1, 1, 1))
print("Contrast matrix for testing coincidence")
con.coincidence
# notice that manova won't work on a single variable so we need to use anova
#heart.manova.coincidence <- manova(cbind(t1,t2,t3,t4)%*%t(con.coincidence)
~ drug, data=heart.data)
#summary.manova(heart.manova.coincidence)$Eigen.values
#summary.manova(heart.manova.coincidence)$Df
#summary.manova(heart.manova.coincidence)$Stat

heart.manova.coincidence <- aov(cbind(t1,t2,t3,t4)%*%t(con.coincidence) ~
drug, data=heart.data)
summary(heart.manova.coincidence)

2. Specifying sort orders.

The function "order" takes a set of variables and returns the index with
sorting done from left to right, eg. order(a, b, c) sorts by variable a,
then b within a, c within b within a.

However, the aggregate function requires the sorting order to be specified
in the reverse order. I would think that the sorting order should be
specified in a standard fashion in all functions where it applies.

e.g. price <- price[order(dept, course), ] # sort by dept first,
then course within dept
ctotdiff <- aggregate(cbind(diff), list(course = course, dept =
dept), FUN = sum)

3. standard errors

These should be available for all models after fitting in a standard
fashion using the same type of calling sequence.

predict.glm has an se.fit option
predict.lm has an se.fit option
predict.lme does NOT have an se.fit option
predict.mlm does NOT have an se.fit option
etc.
If you are making predictions, it seem sensible that se should be available
for the predictions.

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news