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 |
"Kakouros, Nikolaos" <Nikolaos.Kakouros@umassmemorial.org> |

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

Subject |
RE: st: Tobit graphics |

Date |
Sun, 30 Dec 2012 17:21:22 +0000 |

It still doesn't work... marginsplot, recast(line) recastci(rarea) addplot( (scatter x y) (lfictci x2 y2, yaxis(2)) (scatter x2 y2, yaxis(2))) --> gives axes stacked on the left marginsplot, recast(line) recastci(rarea) addplot( (scatter x y) (lfictci x2 y2, yaxis(2)) (scatter x2 y2, yaxis(2))) yaxis(1 2) --> option yaxis() not allowed marginsplot, recast(line) recastci(rarea) addplot( (scatter x y) (lfictci x2 y2, yaxis(2)) (scatter x2 y2, yaxis(2))) yaxis(1 2) --> yaxis is not a twoway plot type marginsplot, recast(line) recastci(rarea) addplot( yaxis(1 2) (scatter x y) (lfictci x2 y2, yaxis(2)) (scatter x2 y2, yaxis(2))) --> ) required marginsplot, recast(line) recastci(rarea) addplot( (scatter x y, yaxis(1 2) ) (lfictci x2 y2, yaxis(2)) (scatter x2 y2, yaxis(2))) --> no error but result same as initially (ie axes stacked on left hand side). I have run out of options on where to enter it it seems! Any further suggestions on the command syntax? Thanks, Nikos ________________________________________ From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] on behalf of Nick Cox [njcoxstata@gmail.com] Sent: Sunday, December 30, 2012 10:19 AM To: statalist@hsphsun2.harvard.edu Subject: Re: st: Tobit graphics -yaxis(1 2)- is a standard -twoway- option. It belongs in your -addplot()- option. Nick On Sun, Dec 30, 2012 at 1:53 PM, Kakouros, Nikolaos <Nikolaos.Kakouros@umassmemorial.org> wrote: > Where do you declare yaxis(1 2) though? > It is not an option for marginsplot and setting it in the first addplotted scatter as an option doesn't seem to make a difference. I used yaxis(2) for the secondary scatter and lfitci but that places the second y axis to the left of the first one. > Sure - I can move it to the right with the graph editor but where's the fun in that? Nick Cox [njcoxstata@gmail.com] > In this kind of problem I usually declare > > yaxis(1 2) > > and then if stuff I want is in the wrong place so far as I am concerned I write > > yaxis(2) > > instead of > > yaxis(1) > > and/or vice versa. > > Nick > > On Thu, Dec 27, 2012 at 6:23 PM, Kakouros, Nikolaos > <Nikolaos.Kakouros@umassmemorial.org> wrote: > >> The plot thickens on the Tobit graphics. >> >> marginsplot, recast(line) recastci(rarea) addplot( (scatter x y) (lfictci x2 y2) (scatter x2 y2)) >> >> worked, but the second set of data needs a different y axis. >> >> I tried >> >> marginsplot, recast(line) recastci(rarea) addplot( (scatter x y) (lfictci x2 y2, yaxis(2)) (scatter x2 y2, yaxis(2))) >> >> but the second y axis ends up stacked on the left rather than being on the right. > > Kakouros, Nikolaos > >> Trust me, Dr Cox. For me to get this to work, quite a bit of luck would be needed. >> Your recommendation worked, though. >> >> I used >> marginsplot, recast(line) recastci(rarea) addplot( (scatter x y) (lfictci x2 y2) (scatter x2 y2)) >> >> and it worked great! > > Nick Cox > >> Not clear why luck should be needed, but it's not necessary to specify -twoway-. Otherwise specify what kind of error message you got. > > On 27 Dec 2012, at 13:21, "Kakouros, Nikolaos" > <Nikolaos.Kakouros@umassmemorial.org > >>> Ro'I, >>> Many thanks - that works great! I changed recastci(rline) to >>> (rarea) to get the same shaded CI effect as lfitci. >>> >>> Now - is it possible to show this data on the same graph as the other >>> dataset's scatter and lfitci? >>> I tried >>> marginsplot, recast(line) recastci(rarea) addplot(twoway (scatter x >>> y) (lfictci x2 y2) (scatter x2 y2)) >>> >>> I also tried >>> Twoway (marginsplot, recast(line) recastci(rarea) addplot(scatter x >>> y)) (lfictci x2 y2) (scatter x2 y2) >>> >>> >>> with no luck... > > Ro'i Zultan > >>> I think the following should work for you: >>> tobit x y, ll(0) >>> margins, at(y=(0(10)100)) >>> marginsplot, recast(line) recastci(rline) addplot(scatter x y) >>> >>> With the margins parameters adjusted for your data. > > 2012/12/26 Kakouros, Nikolaos <Nikolaos.Kakouros@umassmemorial.org> > >>>> I have a set of data and using a twoway scatter and lfitci to show >>>> graphically along with the least-squares regression line and >>>> confidence intervals. >>>> Another set of data, however, is heavily censored with the dependent >>>> variable hitting a floor at 0 (and about a third of values actually >>>> being at zero). >>>> I noted the recent discussion on Tobit, chaired by Maarten Buis. >>>> >>>> I used tobit x y, ll(0) for the regression but not sure how to >>>> recreate the lfitci output (regression line and confidence intervals) >>>> using the tobit regression info to produce the scatter graphic. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/ ...................................................................... The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, transmission, re-transmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

**References**:**st: Tobit graphics***From:*"Kakouros, Nikolaos" <Nikolaos.Kakouros@umassmemorial.org>

**Re: st: Tobit graphics***From:*"Ro'i Zultan" <zultan@bgu.ac.il>

**RE: st: Tobit graphics***From:*"Kakouros, Nikolaos" <Nikolaos.Kakouros@umassmemorial.org>

**Re: st: Tobit graphics***From:*Nick Cox <njcoxstata@gmail.com>

**RE: st: Tobit graphics***From:*"Kakouros, Nikolaos" <Nikolaos.Kakouros@umassmemorial.org>

**RE: st: Tobit graphics***From:*"Kakouros, Nikolaos" <Nikolaos.Kakouros@umassmemorial.org>

**Re: st: Tobit graphics***From:*Nick Cox <njcoxstata@gmail.com>

**RE: st: Tobit graphics***From:*"Kakouros, Nikolaos" <Nikolaos.Kakouros@umassmemorial.org>

**Re: st: Tobit graphics***From:*Nick Cox <njcoxstata@gmail.com>

- Prev by Date:
**Re: st: could not calculate numerical derivatives -- flat or discontinuous region encountered** - Next by Date:
**st: Query about GMM Commands for Instrumental Variable (IV) Oprobit Regression** - Previous by thread:
**Re: st: Tobit graphics** - Next by thread:
**st: hunting for the source of an error - r(603) - Dual Core problem?** - Index(es):