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

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
AW: st: mvnp code Cappellari & Jenkins 2006 |

Date |
Tue, 7 Jul 2009 15:46:20 +0200 |

<> I am a long-time advocate of do-files to accompany the SJ, so far w/o any success. That would help spot such problems and also make them easy to rectify by just changing the do-file... HTH Martin -----Ursprüngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Nick Cox Gesendet: Dienstag, 7. Juli 2009 15:29 An: statalist@hsphsun2.harvard.edu Betreff: RE: st: mvnp code Cappellari & Jenkins 2006 A good way to spot that something was wrong was to notice that `c21' etc are variables, and thus that the code as originally given implied stuffing variables into scalars. That in itself is not illegal in Stata, as Stata would use `c21'[1] etc., but as a general rule that's unlikely to be what you want. Nick n.j.cox@durham.ac.uk Maarten buis --- On Tue, 7/7/09, Charlotte Gary wrote: > Does anyone have tried the code suggested by Cappellari and > Jenkins Stata Journal (2006)in paragraph 3.4? (I have > reported the code at the end) > > I am simply trying to run this code (without changes) but > an error message after “ml maximize” impedes to obtain > the results that the authors show on p. 170. You'll need the change the lines: scalar `cf22' = sqrt( 1 - `c21'^2 ) scalar `cf33' = sqrt( 1 - `c31'^2 - `c32'^2 ) into: scalar `cf22' = sqrt( 1 - `cf21'^2 ) scalar `cf33' = sqrt( 1 - `cf31'^2 - `cf32'^2 ) and change the line: egen `sp'=mvnp(`xb1'`xb2'`xb3'), chol(`C') /// draws($dr) prefix(z) signs(`k1'`k2'`k3') into: egen `sp'=mvnp(`xb1' `xb2' `xb3'), chol(`C') /// draws($dr) prefix(z) signs(`k1' `k2' `k3') (notice the spaces between variable names) * * 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/ * * 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**:**RE: st: mvnp code Cappellari & Jenkins 2006***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**References**:**Re: st: mvnp code Cappellari & Jenkins 2006***From:*Maarten buis <maartenbuis@yahoo.co.uk>

**RE: st: mvnp code Cappellari & Jenkins 2006***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**st: RE: AW: data points within radius?** - Next by Date:
**st: Re: cross-products in Mata** - Previous by thread:
**RE: st: mvnp code Cappellari & Jenkins 2006** - Next by thread:
**RE: st: mvnp code Cappellari & Jenkins 2006** - Index(es):

© Copyright 1996–2015 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |