[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 |
Re: st: Re: tsline if tin error |

Date |
Sat, 13 Jun 2009 17:21:00 +0200 |

<>

** sysuse tsline1, clear tsset lags tw (tsline ar) (tsline ma)/* */ if tin(40,160), /* */ title(My Graph) note(MY NOTE) ** This works perfectly for me. I do not understand what you are trying to say about -tab-, either... HTH Martin _______________________

To: <statalist@hsphsun2.harvard.edu> Sent: Saturday, June 13, 2009 3:07 PM Subject: Re: st: Re: tsline if tin error

I have figure it out now. I can't check the example that you sent as Ihave no Stata install in this computer but in another one with no internetconnection.The "if tin" option doesn't work if I type title and note. Probablysimilar to the tab command: "tab total if women" is possible but not "tabtotal if women, row col" but "tab women, col row"In any case with only if tin and I dont get an error now but the X axisstarts still from january.To change values in X axis, I need to use tlabel:twoway (tsline Women) (tsline Men) (tsline child), title(Women Childrenand Men,size(small)) note(Source: IBC , size(vsmall)) tlabel(2003m32004m3 2005m3 2006m3 2007m3)thanks for your help. Gaby --- On Sat, 6/13/09, Martin Weiss <martin.weiss1@gmx.de> wrote:From: Martin Weiss <martin.weiss1@gmx.de> Subject: Re: st: Re: tsline if tin error To: statalist@hsphsun2.harvard.edu Date: Saturday, June 13, 2009, 7:25 AM <> Well, this code is close in spirit to yours, and does work, so there has to be a material difference that let`s yours fail and not mine: ** sysuse tsline1, clear tsset lags tw (tsline ar) (tsline ma)/* */ if tin(40,160) ** I suspect that you have to specify the arguments to -tin()- differently, as shown in -help f_tin-. HTH Martin _______________________----- Original Message -----From: "Ana Gabriela Guerrero Serdan" <ag_guerreroserdan@yahoo.com>To: <statalist@hsphsun2.harvard.edu> Sent: Saturday, June 13, 2009 2:17 PM Subject: Re: st: Re: tsline if tin error > > Thanks Martin, I tried putting it before the comma but I get > > invalid syntax > r(198); > > > --- On Sat, 6/13/09, Martin Weiss <martin.weiss1@gmx.de> wrote: > >> From: Martin Weiss <martin.weiss1@gmx.de> >> Subject: st: Re: tsline if tin error >> To: statalist@hsphsun2.harvard.edu >> Date: Saturday, June 13, 2009, 7:10 AM >> <> >> >> Apart from any other problems in your code, the -if- >> statement always goes >> before the comma separating the command from its >> options... >> >> twoway (tsline Women) (tsline Men)/* >> */ (tsline child) if tin(Mar 2003, Mar 2008),/* >> */ title(Women Children and Men,size(small)) /* >> */note(Source: IBC , size(vsmall)) >> >> >> HTH >> Martin >> _______________________>> ----- Original Message ----->> From: "Ana Gabriela Guerrero Serdan" <ag_guerreroserdan@yahoo.com>>> To: <statalist@hsphsun2.harvard.edu> >> Sent: Saturday, June 13, 2009 2:06 PM >> Subject: st: tsline if tin error >> >> >> > Dear Statalist, >> > >> > I am doing some tsline graphs and I get an error with >> the "if tin" option. >> > >> > >> > I have data staring in March 2003 and runs for five >> years. When I do a >> > graph with twoway tsline, the X axis starts with Jan >> 2003 and ends in Jan >> > 2008 even if there are no observations. I tried to use >> the if tin but I >> > get an error message. Can anyone let me know how to >> modify dates so the X >> > axis starts from Mar 2003 and goes until Mar 2008 as >> my data suggests? >> > >> > >> > . tsset mdate mdate, format(%tmMon_CCYY) >> > panel variable: >> mdate (weakly balanced) >> > time variable: mdate, >> Mar 2003 to Mar 2008 >> > >> delta: 1 month >> > tab mdate >> > >> > mdate | >> Freq. Percent >> Cum. >> > ------------+----------------------------------- >> > Mar 2003 | >> 1 1.64 >> 1.64 >> > Apr 2003 | >> 1 1.64 >> 3.28 >> > May 2003 | >> 1 1.64 >> 4.92 >> > etc... >> > etc...... >> > Jan 2008 | >> 1 1.64 >> 96.72 >> > Feb 2008 | >> 1 1.64 >> 98.36 >> > Mar 2008 | >> 1 1.64 >> 100.00 >> > ------------+----------------------------------- >> > Total | >> 61 100.00 >> > >> > >> > >> > . twoway (tsline Women) (tsline Men) (tsline child), >> title(Women Children >> > and Men,size(small)) note(Source: IBC , >> size(vsmall)) if tin(Mar 2003, >> > Mar 2008) >> > >> > option if not allowed >> > r(198); >> > >> > >> > thanks in advance, >> > Gaby >> > >> > >> > >> > >> > >> > ---------------------------- >> > Gaby Guerrero Serdán >> > >> > Department of Economics >> > Royal Holloway, University of London >> > TW20 OEX >> > Egham, Surrey >> > England, UK >> > http://www.rhul.ac.uk/Economics/For-Staff/postgrads.html >> > >> > >> > >> > >> > >> > * >> > * 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/ >> > > > > > * > * 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/* * 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/

**References**:**Re: st: Re: tsline if tin error***From:*Ana Gabriela Guerrero Serdan <ag_guerreroserdan@yahoo.com>

- Prev by Date:
**st: Adjusted R square** - Next by Date:
**st: Re: Randomly selecting variables in panel, collapsing, and simulating** - Previous by thread:
**Re: st: Re: tsline if tin error** - Next by thread:
**st: Randomly selecting variables in panel, collapsing, and simulating** - Index(es):

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