Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: R: Creating a dummy dataset in Stata


From   "Carlo Lazzaro" <[email protected]>
To   <[email protected]>
Subject   st: R: Creating a dummy dataset in Stata
Date   Mon, 8 Jul 2013 16:31:50 +0200

Dear Amal,
I am not clear about the meaning of a "dummy dataset".
Anyway, let's assume that you still have the data you mentioned on your post
and your need is inputting them in a .dta file. 
Limiting the example at 3 observation: 

input id RR LL95CI UL95CI group_var

1 2 1.5 3 1
2 1 0.5 1.6 3
3 3 1.5 2.6 2
end

If your need is to sort group_var in ascending order, you can type: 

- sort group_var -

No better contribution springs to my mind. Others on the list can give you
more skillful advices.

Kindest regards,
Carlo
-----Messaggio originale-----
Da: [email protected]
[mailto:[email protected]] Per conto di Amal Khanolkar
Inviato: lunedì 8 luglio 2013 15:50
A: [email protected]
Oggetto: st: Creating a dummy dataset in Stata

Hi,

I would like to create a dummy dataset in Stata. Say I would like to have a
dataset with 4 variables as follows:


1. ID
2. Relative risks
3. Corresponding 95% CI's for RRs
4. A group variable that groups 3 RRs together consecutively from top to
bottom.

I know I have 66 IDs and 66 RRs and thus 22 groups (three RRs in each
group).

I start with setting the number of observations to 66:

set obs 66

I now have no idea how to enter the RR, 95% CI and the group number for each
observation.

Any tips?

Thanks ahead,



/Amal 
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index