# st: R: Data generating

 From "Carlo Lazzaro" To Subject st: R: Data generating Date Thu, 20 Nov 2008 09:39:16 +0100

```Dear Torben,
Question nr 1: How do I do this in stata?
Answer nr 1 (please, consider that what follows refers to each one of your
years. I assume that the annual value a is 100):
set obs 12
g a=100/12
Question nr 2: How do I do it in stata if I want to assume a non-zero
variance still maintaining the sum of the monthly data equals the annual
data?
Answer nr 2: corr2data b, means(8.3333333)

sum  a b

Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
a |        12    8.333333           0   8.333333   8.333333
b |        12    8.333333           1   6.919311   9.956305

. total a b

Total estimation                    Number of obs    =      12

--------------------------------------------------------------
|      Total   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
a |        100          0             .           .
b |        100   3.464102      92.37556    107.6244
--------------------------------------------------------------

HTH and Kind Regards,

Carlo
-----Messaggio originale-----
Da: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di Torben Mideksa
Inviato: giovedì 20 novembre 2008 9.18
A: statalist@hsphsun2.harvard.edu
Oggetto: st: Data generating

Dear Statalist participants,

I have a list of annual data like

Year		variable_X		variable_Y ...
1900		a			b
.		.			.
.		.			.
.		.			.
1950		c			d

For some reasons, based on annual data alone, I am interested in generating
monthly data for the two or more variables, assuming the monthly data has
zero variance with the average value for each month amounting to annual
value divided by 12. That is, I need

Year		variable_X		variable_Y ...
1900M1		a/12			b/12
1900M2		a/12			b/12
1900M3		a/12			b/12
.		.			.
.		.			.
.		.			.
1900M12		a/12			b/12
.		.			.
.		.			.
.		.			.
1950M12		c/12			d/12

Question nr 1: How do I do this in stata?
Question nr 2: How do I do it in stata if I want to assume a non-zero
variance still maintaining the sum of the monthly data equals the annual
data?

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