2008/8/28  <[EMAIL PROTECTED]>:

> hazard <- function(x,shape,scale)
> {
>   return (shape/scale) * (x/scale)^(shape - 1)
> }
>
> Only return a single value? It is like x becomes a single value passed as an 
> argument.
>

 It's evaluating return(shape/scale) and returning that! Add some
extra parentheses:

 return( (shape/scale) * (x/scale)^(shape-1) )

 seems to work. Are you a python programmer, perhaps?

Barry

______________________________________________
[email protected] 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