UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

Stata FAQ
How can I input a small dataset quickly?

The answer to this question involves the use of the input command.

Let's say that you want to enter the following data:

x  y
32 56
26 67
34 61
39 58
29 58
Here is how you would do it:
input x y
32 56
26 67
34 61
39 58
29 58
end

list

             x          y 
  1.        32         56  
  2.        26         67  
  3.        34         61  
  4.        39         58  
  5.        29         58  
 
summarize

Variable |     Obs        Mean   Std. Dev.       Min        Max
---------+-----------------------------------------------------
       x |       5          32   4.949747         26         39  
       y |       5          60   4.301163         56         67
Note: You wouldn't want to use this method with anything other than a very small dataset. With a larger dataset you might want to use Stata's editor (edit command), the infile command or the insheet command.
For More Information

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California