From: David Groos <david.groos_at_mpls.k12.mn.us>

Date: Sat 16 Jul 2005 - 13:47:01 EST

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 Received on Sat Jul 16 13:52:29 2005

Date: Sat 16 Jul 2005 - 13:47:01 EST

Thank you-all very much for your help, your responses and help has been very encouraging. The following doesn't close the case but it tables it...

Anyway, I then copied the non-working, pasted it into Console,
expecting that it would say "Error: syntax error" upon pressing the
return key at the end of this line:

*>> + tst<-(yb1-yb2)/sqrt(s*(1/n1+1/n2))
*

but it didn't! and the code worked this time, also!
I then went about doing what I could to replicate the error from before
and was as unsuccessful in doing that as I was in making it work,
earlier.

*>>
*

On Jul 15, 2005, at 4:43 PM, Peter Dalgaard wrote:

> "Bret Collier" <bret@tamu.edu> writes:

*>
**>> David,
**>> If below is exactly what you typed, check your code again, I think you
**>> are missing a '}' after the last 2 parentheses.
**>
**> That's not supposed to cause a syntax error, just another '+'.
*

(right! that's what I thought...)

> I can copy and paste the code as written and not get an error:

*>
**>> twosam<-function(y1, y2) {
**> + n1<-length(y1);n2 <-length(y2)
**> + yb1<-mean(y1); yb2<-mean(y2)
**> + s1<-var(y1);s2<-var(y2)
**> + s<-((n1-1)*s1 + (n2-1)*s2)/(n1+n2-2)
**> + tst<-(yb1-yb2)/sqrt(s*(1/n1+1/n2))
**> + }
**>>
**>
**> Perhaps this was the 1st time David got his typing right? The error is
**> of the sort you'd get if you had
**>
**> s<-((n1-1)*s1 + (n2-1)*s2/(n1+n2-2)
*

Interestingly enough, I did try this line when first I was trying to
make the code work and with just 1 ")" at the end I didn't get the
error message, but then again I wasn't able to make the whole program
work, either.

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 Received on Sat Jul 16 13:52:29 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:33:45 EST
*