Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Richard Herron <richard.c.herron@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: How to pass scalar argument to a function's options (-prvalue- in this case) |

Date |
Mon, 19 Dec 2011 12:07:29 -0500 |

I think this is a gross conceptual error I have in how Stata uses scalars, but I have an example using Long and Xu's -prvalue-. I would like to evaluate a -probit- model with a logged right hand side variable at the "log of the mean" instead of at the "mean of the log." I find the mean with -summarize- then store the log with -scalar-, but when I pass -log_mean_weight- as an argument to the -x()- option in -prvalue- I get the following error 'log_mean_weight' found where number expected Here is some reproducible code * begin code sysuse auto, clear generate log_weight = log(weight) generate price_dummy = (price > 10000) probit price_dummy log_weight mpg length * I would like to determine probability at the log of mean weight summarize weight, meanonly scalar log_mean_weight = log(r(mean)) prvalue, x(log_weight = log_mean_weight) * end code I have also unsuccessfully tried to use a -tempname- instead of -scalar-, but in that case -prvalue- returns '__000000' found where number expected Thanks! I think (well, hope) that this scalar problem is my last major Stata blind spot. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**st: RE: How to pass scalar argument to a function's options (-prvalue- in this case)***From:*Nick Cox <n.j.cox@durham.ac.uk>

- Prev by Date:
**Re: st: Regressions with dependent continuous variable with bounded range** - Next by Date:
**st: Analysis admissions after liver transplant** - Previous by thread:
**st: Ordering a varlist according to "parent" and "child" variables** - Next by thread:
**st: RE: How to pass scalar argument to a function's options (-prvalue- in this case)** - Index(es):