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

st: SV: RE: SV: RE: Making symmetry

From   "Alexander" <[email protected]>
To   <[email protected]>
Subject   st: SV: RE: SV: RE: Making symmetry
Date   Sun, 13 Apr 2003 23:28:44 +0200


Sorry about that. I should have searched the posts...

Both methods works perfectly. My first posting was however not 100%
correct. In addition to Id1 and Id2 I have several other variabels in
the dataset. When I run the code you suggested for me the other
variabels stays the way they were before.


Id1	Id2	Gender
1	2	Male
2	4	Female
3	5	Female

Then i run the code:
levels Id2, local(levels) 
replace Id2 = . 
foreach l of local levels { 
 	qui replace Id2 = `l' if Id1 == `l' 

And the result is:
Id1	Id2	Gender
1	.	Male
2	2	Female
3	.	Female
4	4
5	5

I would like the variabel 'Gender' to follow Id2
Id1	Id2	Gender
1	.	.
2	2	Male
3	.	.
4	4	Female
5	5	Female

I have tried to modify your code, but I cannot make it work...

Any suggestions would be greatly appreciated.

Nick, did you get any results on your post 'MS software and Stata: a
proposal', tips and tricks for exporting Stata results into MS Office
applications? If not, I can try to make a FAQ like you proposed. 

Best regards,
Alexander Severinsen

-----Opprinnelig melding-----
Fra: [email protected]
[mailto:[email protected]] P� vegne av Nick Cox
Sendt: 11. april 2003 14:09
Til: [email protected]
Emne: st: RE: SV: RE: Making symmetry

> The 'gen draft...' method works perfectly.
> It seems like the first method with 'levels' is only for
> version 8 of
> stata? It get the error message; version 8 not supported...

The same question was asked on 8 April, 
so here is the same answer: 

> In detail, yes. In general, please note the advice in
> the Statalist FAQ 

> "The current version of Stata is 8. Please specify if you are
> using an earlier version; otherwise, the answer to your 
> question is likely to refer to commands or features 
> unavailable to you." 

> In particular, the description yielded by

> . ssc inst levels

> explains that -levels- is for Stata 8, and that -levels7-
> is available for Stata 7. So just substitute -levels7- 
> for -levels-. 

[email protected] 
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index