[R] Strange problem.

Dowkiw, Arnaud Arnaud.Dowkiw at dpi.qld.gov.au
Fri Sep 5 03:37:41 CEST 2003


By the way, Dong,

you shouldn't use the term "mean" in Splus to designate the mean of your trait  (mean<-8000). "mean' is an Splus function, and by doing mean<-8000, you may experience problems when you'll need the argument "mean" to designate the original Splus function (as in the function model.tables.aov(object.aov,type="effects") for example). I tell you that because I had this problem today. Some of the function I had created and that worked before wouldn't work anymore and I realised this was because of that "mean" element that I had generated to help you solve your problem and that I forgot to erase.

Arnaud


-----Original Message-----
From: Yannong.Dong-1 [mailto:Yannong.Dong-1 at ou.edu]
Sent: Tuesday, 2 September 2003 11:21 AM
To: r-help at stat.math.ethz.ch
Subject: [R] Strange problem.


Hi, everyone,
    I am a new user of R. Recently, I tried the following commands, but couldn't make them work. If any one of you has some ideas about it, please help me. The commands are

>std<-1000
>mean<-8000
>prior<-function(n){1/(sqrt(2*pi)*std)*exp(-1.0*(n-mean)^2/(2*std^2))}
>plot(prior,1,15000)
>post<-function(n){
+ if(n < 9543) 
+  0
+ else
+  prior(n)/n
+ }
>plot(post,1,15000)  # This command didn't work. The error message is " x and y lengths differ "

I was really confused about it because the first function "prior" can work well. I think I must make something wrong stupidly, but could not find it. If you can help me about it, it would be very helpful. Thanx a lot in advance.

   Rgds, 
   Yannong Dong

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help 

********************************DISCLAIMER******************...{{dropped}}




More information about the R-help mailing list