[R] fit a nonlinear model using nlm()

2007-07-17 Thread William Simpson
I am trying to fit a nonlinear model using nlm(). My application of nlm() is a bit complicated. Here is the story behind the model being fit: The observer is trying to detect a signal corrupted by noise. On each trial, the observer gets stim=signal+rnorm(). In the simulation below I have 500

[R] dose-response on a grid

2007-07-12 Thread William Simpson
I have the following problem. I have measured a dose response curve (binary response, continuous dose) on a grid of x,y positions. I would like to produce a grey-level plot that shows the LD50 at each (x,y) position. I am thinking that I have to do something like fit-glm(resp ~ x*y + dose, family

[R] lme() F-values disagree with aov()

2006-08-14 Thread William Simpson
I have used lme() on data from a between-within subjects experiment. The correct ANOVA table is known because this is a textbook example (Experimental Design by Roger Kirk Chapter 12: Split-Plot Factorial Design). The lme() F-values differ from the known results. Please help me understand why.

Re: [R] lme() F-values disagree with aov()

2006-08-14 Thread William Simpson
Your lme statement is OK. To get the usual split-plot anova, your aov statement should be fit2 - aov(y ~ a*b*c + Error(s), data = d) No, this gives wrong F-values. By wrong I mean it does not agree with the published table. Table 12.10-2, page 559: Number of obs =

Re: [R] lme() F-values disagree with aov()

2006-08-14 Thread William Simpson
Thanks very much Peter! Your lme statement is OK. To get the usual split-plot anova, your aov statement should be fit2 - aov(y ~ a*b*c + Error(s), data = d) No, this gives wrong F-values. By wrong I mean it does not agree with the published table. Well, it's the model that is

Re: [R] between-within anova: aov and lme

2006-08-04 Thread William Simpson
Well nobody answered :-( Nobody on R-help is doing anovas I guess -- I don't blame them! (It's just for aggies.) In the absence of any response and for no good reason I am doing: fitn1 - aov(amplitude ~ stereo*site*stimulus + Error(subject), stereon1) This is Bill Venables's way. And when the

[R] between-within anova: aov and lme

2006-08-03 Thread William Simpson
I have 2 questions on ANOVA with 1 between subjects factor and 2 within factors. 1. I am confused on how to do the analysis with aov because I have seen two examples on the web with different solutions. a) Jon Baron (http://www.psych.upenn.edu/~baron/rpsych/rpsych.html) does 6.8.5 Example 5: