Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Create Dataset from Nowhere in Stata


From   [email protected]
To   [email protected]
Subject   st: Create Dataset from Nowhere in Stata
Date   Thu, 25 Aug 2005 16:29:16 -0500

Does anyone know how to make up a "psudo "dataset in stata? By psudo data, I
mean the data is not collected by survey. For example, I want to use data to
test my theory. however, I do not have a dataset. I therefore assume some
characteristics of certain population and "make up " a dataset according to ,y
assumption. In spss, I can create a 10 variable 100 cases by the syntax below.
However, how can I do the corresponding thing in Stata?


* the following syntax create a file with 10 var and 100 cases.
input program.
vector v(10).
loop cases=1 to 100.
loop #i=1 to 10.
compute v(#i)=uniform(1).
end loop.
end case.
end loop.
end file.
end input program.
exe.


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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