Statalist


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

FW: st: RE: RE: RE: RE: distribution curve with svy


From   Holly Kosiewicz <[email protected]>
To   <[email protected]>
Subject   FW: st: RE: RE: RE: RE: distribution curve with svy
Date   Wed, 9 Sep 2009 07:59:48 -0400

Hi Steve, Martin, and Nick,

First, thanks again for your help. I tried both distplot and cumul to draw my distribution curves and Stata rejects both commands stating that I am using invalid syntax. For what reason(s), I don't know. I am working with Intercooled Stata 9 and I am wondering if its outdatedness may be the issue here.   

Just to clue in on what I am seeing, I am sending my Stata output. Unfortunately, Stata doesn't really help to explain what the problem is other than you have one. 

OUTPUT: 

clear

. set mem 300m
(307200k)

. cd "K:\Mott\American Community Survey\ACS Michigan PUMA 2005-2007 data" 
K:\Mott\American Community Survey\ACS Michigan PUMA 2005-2007 data

. use puma_population_0507.dta


. destring schl, replace
schl has all characters numeric; replaced as byte
(10040 missing values generated)

. gen dropout=1 if schl==1 | schl==2 | schl==3 | schl==4 | schl==5 | schl==6 | schl==7 | sch
> l==8
(210809 missing values generated)

. 
. replace dropout=0 if  schl==9 | schl==10 | schl==11 | schl==12 | schl==13 | schl==14 | ///
>  
> schl==15 | schl==16
(200769 real changes made)


. distplot line pincp [fweight==pwgtp] if dropout==1 
invalid syntax
r(198);

end of do-file
r(198);

. do "C:\DOCUME~1\HKOSIE~1\LOCALS~1\Temp\STD02000000.tmp"

. cumul pincp if dropout==1 [fweight==pwgtp], gen(incdrop1)
invalid syntax
r(198);

end of do-file
r(198);

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: Tuesday, September 08, 2009 4:16 PM
To: [email protected]
Subject: Re: st: RE: RE: RE: RE: distribution curve with svy

Holly,

To show us exactly what you typed (and what Stata reported), paste
your commands and error message directly from the Stata log or results
window into your email.

The FAQ suggest that if you have a strange error, you try to reproduce
it with a standard data set. In Stata Version 10, I just ran the
following with no errors.  How about you?

**********************************************
sysuse auto,clear
cumul mpg if foreign==1 [fweight=rep78], gen(cmpg)
***********************************************
-Steve

On Tue, Sep 8, 2009 at 3:20 PM, Holly Kosiewicz<[email protected]> wrote:
> Hi Steve,
>
> My weights are integers.
>
> Holly
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Tuesday, September 08, 2009 3:18 PM
> To: [email protected]
> Subject: Re: st: RE: RE: RE: RE: distribution curve with svy
>
> --
> Frequency weights (fweights)  must be integers, but your survey
> weights probably are not in general  To convert the survey weights to
> proportional frequency weights equivalent to two decimal places (which
> should be more than enough):
>
> gen fwt_new =round(100*pwgt,1)
>
> and use that for your fweight.
>
> I
> -Steve
>
> On Tue, Sep 8, 2009 at 2:45 PM, Holly Kosiewicz<[email protected]>
> wrote:
>> I know Stata is a bit finicky at times, but I just eliminated the
> space and Stata is still telling me I am using invalid syntax. The space
> is not the problem.
>>
>> -----Original Message-----
>> From: Martin Weiss [mailto:[email protected]]
>> Sent: Tuesday, September 08, 2009 2:42 PM
>> To: [email protected]
>> Subject: st: RE: RE: RE: distribution curve with svy
>>
>>
>> <>
>> No blank after -gen-! Just " gen(incdrop)"
>>
>>
>> HTH
>> Martin
>>
>>
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]] On Behalf Of Holly
> Kosiewicz
>> Sent: Dienstag, 8. September 2009 20:28
>> To: [email protected]
>> Subject: st: RE: RE: distribution curve with svy
>>
>> Hi Martin,
>>
>> Thanks very much for your help. It seems as though this command may
> work.
>> Unfortunately, when I type "cumul pincp if dropout==1 [fweight=pwgpt],
> gen
>> (incdrop)", stata tells me I am using an invalid syntax. It seems as
> though
>> I am following the syntax given in the help window for cumul so I
> can't tell
>> where Stata is finding the error.
>>
>> Any thoughts?
>
> --
> Steven Samuels
> [email protected]
> 18 Cantine's Island
> Saugerties NY 12477
> USA
> 845-246-0774
> *
> *   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/
>



-- 
Steven Samuels
[email protected]
18 Cantine's Island
Saugerties NY 12477
USA
845-246-0774

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



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