[R] unique sets of factors

2006-10-19 Thread Tony Long
All:

I have a matrix, X, with a LARGE number of rows.  Consider the 
following three rows of that matrix:

1 1 1 1 2 2 3 3
1 1 1 1 3 3 2 2
3 3 2 2 1 1 1 1

I wish to fit many one-way ANOVAs to some response variable using 
each row as a set of factors.  For example, for each row above I will 
do something like anova(lm(Y~as.factor(X[1,]))).  My problem is that 
in the above example, I do not want to fit models for both rows 1 and 
2 as they are essentially duplicates in terms of the ANOVA model. 
Clearly row 3, although it has the same number of 1's, 2's, and 3's, 
is a different model.

Is there some computationally efficient way to remove such factor 
duplicates from my large matrix?  I have been banging my head 
against the wall all morning.

Thanks!!

Tony
-- 
###

Tony Long

Ecology and Evolutionary Biology
Steinhaus Hall
University of California at Irvine
Irvine, CA
92697-2525

Tel:  (949) 824-2562   (office)
Tel:  (949) 824-5994   (lab)
Fax: (949) 824-2181

email:  [EMAIL PROTECTED]
http://hjmuller.bio.uci.edu/~labhome/

__
R-help@stat.math.ethz.ch 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.


[R] scatterplot smoothing using gam

2003-07-24 Thread Tony Long
All:

	I am trying to use gam in a scatterplot smoothing problem. 
The data being smoothed have greater 1000 observation and have 
multiple humps.  I can smooth the data fine using a function 
something like:

out - ksmooth(x,y,normal,bandwidth=0.25)
plot(x,out$y,type=l)
The problem is when I try to fit the same data using gam

out - predict.gam(gam(y~s(x)),se=TRUE)
plot(x,out$fit,type=l)
I only seem to get fits that would correspond to big bandwidths 
using ksmooth, and straight lines are always fit to the data.  I do 
not appear to appreciate how to control bandwidth using gam.  As 
even if I apply something like the gam model above to the smoothed 
out$y generated using ksmooth it tends to flatten out the smoothing 
curve.
--
###

Tony Long

Ecology and Evolutionary Biology
Steinhaus Hall
University of California at Irvine
Irvine, CA
92697-2525
Tel:  (949) 824-2562   (office)
Tel:  (949) 824-5994   (lab)
Fax: (949) 824-2181
email:  [EMAIL PROTECTED]
http://hjmuller.bio.uci.edu/~labhome/
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help