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

st: RE: Create Dataset from Nowhere in Stata


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Create Dataset from Nowhere in Stata
Date   Thu, 25 Aug 2005 22:34:18 +0100

Absolutely. 

set obs 100 
forval j = 1/10 { 
	gen v`j' = uniform()
} 

P.S. what's SPSS? 

Nick 
n.j.cox@durham.ac.uk 

mzhang@nd.edu
 
> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index