Re: [R] trigonometric regression

2010-06-17 Thread William Simpson
Thanks, Bill! Bill On Thu, Jun 17, 2010 at 5:12 PM, William Dunlap wrote: > > You can also define a function that keeps the cos > and sin terms together so anova(fit) shows > one entry for the (cos,sin) pair.  E.g., define > the following function >  cs <- function(x, freq)cbind(cos=cos(x*freq)

Re: [R] trigonometric regression

2010-06-17 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan Murdoch > Sent: Thursday, June 17, 2010 3:19 AM > To: William Simpson > Cc: r-help@r-project.org > Subject: Re: [R] trigonometric regression >

Re: [R] trigonometric regression

2010-06-17 Thread William Simpson
Got it now. I do anova(lm(y~ 1),lm(y~ cf+sf)) Bill __ R-help@r-project.org 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-contai

Re: [R] trigonometric regression

2010-06-17 Thread William Simpson
var(y)*length(y) I mean. (SSE) Bill On Thu, Jun 17, 2010 at 1:34 PM, William Simpson wrote: > Yes,  I want the same test as is done for b[1] and b[2] in the summary > table -- for H0: b[]==0. > > OK, do F-test on full model with cf and sf vs reduced model with intercept > only. > I want to test

Re: [R] trigonometric regression

2010-06-17 Thread William Simpson
Yes, I want the same test as is done for b[1] and b[2] in the summary table -- for H0: b[]==0. OK, do F-test on full model with cf and sf vs reduced model with intercept only. I want to test y~cf + sf vs y~ intercept (ie mean) -- I guess I just use var(y) Thanks Duncan for your help Bill On T

Re: [R] trigonometric regression

2010-06-17 Thread Duncan Murdoch
William Simpson wrote: Suppose I do a trigonometric regression fit<-lm(y~ cf + sf) where cf and sf are the cos and sine components. b<-coef(fit) I have the fitted sine component b[2] and the cos component b[3]. Doing summary(fit) gives me the p-values and SEs for b[2] and b[3]. But I want the a

[R] trigonometric regression

2010-06-17 Thread William Simpson
Suppose I do a trigonometric regression fit<-lm(y~ cf + sf) where cf and sf are the cos and sine components. b<-coef(fit) I have the fitted sine component b[2] and the cos component b[3]. Doing summary(fit) gives me the p-values and SEs for b[2] and b[3]. But I want the amplitude of the fitted wa