On 27-Feb-10 17:57:56, Cardinals_Fan wrote:
> 
> One last question.  I'm trying to use the rnorm() function to
> draw a distribution for my coefficient estimates.  Let's say
> I have a model y* = a + b1x1.  I have the coefficient estimate
> for b1 stored as b1 and the standard error estimate for b1
> stored as s1.  I run rnorm function as
> 
> a <- rnorm(1000,b1,s1) 
> 
> and I get NA values in the vector.  If i dont use scalars it
> works fine.  Is there a special way scalars are entered to
> make it work?  I have also tried the dnorm command.
> 
> --

It should not happen that you get NAs *provided s1 >= 0 and
neither b1 nor s1 is NA*. So check what values you have stored
in b1 and s1. (In fact if you have s1 < 0 you will get NaN
rather than NA, so "s1 < 0" should not be the source of the problem).

What I suspect is that, for some reason to do with your data,
you have got NA for 'a' or for 'b1'.

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <ted.hard...@manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 27-Feb-10                                       Time: 18:25:02
------------------------------ XFMail ------------------------------

______________________________________________
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-contained, reproducible code.

Reply via email to