[R] Help Computing Probit Marginal Effects

Peter Ehlers ehlers at ucalgary.ca
Sat Feb 27 19:19:19 CET 2010


On 2010-02-27 10:57, 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

I don't understand what "don't use scalars" means.
I think that your problem is with the word "stored"? *How* are these
values 'stored'?
If you have

  b1 <- 3.14
  s1 <- 1.41

then

  rnorm(1000, b1, s1)

will not produce NAs.

> there a special way scalars are entered to make it work?  I have also tried
> the dnorm command.

This is a bit worrying - why would you consider dnorm when you want a
random sample? Or do you just want to plot the Normal curve with mean
equal to b1 and SD equal to s1?

-- 
Peter Ehlers
University of Calgary



More information about the R-help mailing list