Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: forvalues


From   [email protected]
To   [email protected]
Subject   Re: st: forvalues
Date   Tue, 23 Oct 2012 19:08:59 +0000

Hi All,
 This is a recalcitrant, immature and unfriendly altitude. I suggest that in future such poster's question should not be answered.
Thanks.
Sola Olorunfemi.
Sent from my BlackBerry wireless device from MTN

-----Original Message-----
From: "Justina Fischer" <[email protected]>
Sender: [email protected]
Date: Tue, 23 Oct 2012 15:34:28 
To: <[email protected]>
Reply-To: [email protected]: Re: st: forvalues

Personally, I think this is a very uncooperative attitude, and I do appreciate that the rest of the list-posters is nicer.

But are you a man or a woman ?

Justina

-------- Original-Nachricht --------
> Datum: Tue, 23 Oct 2012 14:27:19 +0100
> Von: - <[email protected]>
> An: [email protected]
> Betreff: Re: st: forvalues

> Yes, I ignored it because I just wrote back to thank you for your
> suggestion, not to
> post anything else, and at this point I don't have the time to go into
> my gmail account
> and amend my settings. If I post anything else, I will. Besides, for
> all the people posting as
> "jenny hill at gmail" or "nick fly at wherever" you don't know if
> these are their real names, do you?
> 
> On 23 October 2012 14:20, Nick Cox <[email protected]> wrote:
> > You are ignoring the comment made now to you directly at least three
> > times on this list that you are expected to use your real name on this
> > list.
> >
> > In your own best interests please find out _now_ how to show your real
> > name in people's inboxes.
> >
> > That said, what you are asking is covered by an FAQ.
> >
> > FAQ     . . . . . . . . . . Making foreach go through all values of a
> variable
> >         . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N.
> J. Cox
> >         8/05    Is there a way to tell Stata to try all values of a
> >                 particular variable in a foreach statement without
> >                 specifying them?
> >                 http://www.stata.com/support/faqs/data-management/
> >                 try-all-values-with-foreach/
> >
> >
> >
> > Nick
> >
> > On Tue, Oct 23, 2012 at 2:15 PM, - <[email protected]> wrote:
> >> Thank you for this,
> >> it is working now using levelsof, as I wrote above, but I will try
> >> your suggestion as well.
> >>
> >> thanks again
> >>
> >> On 23 October 2012 14:11, Nick Cox <[email protected]> wrote:
> >>> dimpol7 asked what he or she is doing wrong.
> >>>
> >>> First off, as already pointed out to dimpol7, we ask for full real
> >>> names on Statalist. See my posting replying to dimpol7 on 12 October.
> >>>
> >>> Second off,
> >>>
> >>> forvalues i = 1/53 {
> >>>         tabstat age if single=='i', by(sexcat) stats(mean sd n min max
> >>> median p10 p25 p75 p90)
> >>> }
> >>>
> >>> will fail if there are _any_ value of -single- in 1/53 for which there
> >>> are no observations. Stata is disagreeing with you on that, but all my
> >>> money is on Stata being right and you being wrong here.
> >>>
> >>> I suggest that you try
> >>>
> >>> di "`i'"
> >>> capture noisily tabstat age if single=='i', by(sexcat) stats(mean sd n
> >>> min max median p10 p25 p75 p90
> >>>
> >>> A line displaying which value this is going to be needed to
> >>> distinguish the tables. -capture noisily- will proceed past any
> >>> errors.
> >>>
> >>> Nick
> >>>
> >>>
> >>> On Tue, Oct 23, 2012 at 1:14 PM, - <[email protected]> wrote:
> >>>> It still won't do it, it says "no observations", but there are
> >>>> observations there...
> >>>>
> >>>> On 23 October 2012 13:09, Henrik Støvring <[email protected]>
> wrote:
> >>>>> Your accents are off. You need to replace 'i' with `i' - note the
> >>>>> difference in the first accent.
> >>>>>
> >>>>> Best,
> >>>>>
> >>>>> Henrik
> >>>>>
> >>>>> On 10/23/2012 02:04 PM, - wrote:
> >>>>>> hello all,
> >>>>>> I'm trying to build a simple loop, and have looked at Help for
> >>>>>> "foreach" and "forvalues", but can't get it to work. I just want to
> >>>>>> set a variable i to take consecutive values from 1 to 53, so use
> >>>>>> forvalues i=1/53, then give its value to a variable in my data
> called
> >>>>>> "single" (refers to the number of samples for each person) which
> has
> >>>>>> integer values ranging from 1 to 53, and create tables of
> statistics
> >>>>>> for age in men and women. So there would be 53 tables of ages, one
> for
> >>>>>> each number of samples, summarized by sex.
> >>>>>> Haven't use loops in stata before, I write:
> >>>>>>
> >>>>>> forvalues i = 1/53 {
> >>>>>>    2. tabstat age if(single=='i'), by(sexcat) stats(mean sd n min
> max
> >>>>>> median p10 p25 p75 p90)
> >>>>>>    3. }
> >>>>>>
> >>>>>> but the message is that 'i' is an invalid name. If I use
> >>>>>> if(single==i), it says "i not found". Can anyone tell me what I'm
> >>>>>> doing wrong?
> >>>
> >>> *
> >>> *   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/
> >>
> >> *
> >> *   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/
> >
> > *
> > *   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/
> 
> *
> *   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/
*
*   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/

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index