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

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

From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RE: RE: RE: RE: distribution curve with svy
Date   Tue, 8 Sep 2009 20:22:46 +0100

In addition to -cumul-, -distplot- from STB/SJ has been supporting
distribution plots since 1999. -search distplot- to see locations. 

[email protected] 

Martin Weiss

What happens when you run this example? Works for me...

set obs 10000

gen byte dropout=/*
gen pincp=rnormal()
gen pwgpt=1+int(10*runiform())

cumul pincp if dropout==1 /*
*/[fweight=pwgpt], gen(incdrop)

line incdrop pincp/*
*/ if dropout==1, sort

Holly Kosiewicz

I know Stata is a bit finicky at times, but I just eliminated the space
Stata is still telling me I am using invalid syntax. The space is not

Martin Weiss [mailto:[email protected]] 

No blank after -gen-! Just " gen(incdrop)"

Holly Kosiewicz

Thanks very much for your help. It seems as though this command may
Unfortunately, when I type "cumul pincp if dropout==1 [fweight=pwgpt],
(incdrop)", stata tells me I am using an invalid syntax. It seems as
I am following the syntax given in the help window for cumul so I can't
where Stata is finding the error. 

Martin Weiss [mailto:[email protected]] 

How about the second example in -help cumul-?

Holly Kosiewicz

I currently have a dataset that contains a sample of individuals; this
dataset also contains a final weight variable that can be used to
population estimates.

I would like to draw a distribution curve of a variable that measures
income, by the educational attainment level of the individual.  The end
is to see two  distributional curves - each curve representing a
with a specific educational attainment level - one superimposed on the
other, and compare them. Ideally, I would make these comparisons based
the population, not on the sample.

The first thing that came to mind was a histogram command, but I noticed
that the only curve that it can generate is a normal curve. That's not
I want. Then I thought about using a graph twoway scatterplot, but that
does not produce the distributional curve that I want. Any thoughts?

*   For searches and help try:

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