Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: copying contents form existing to new variable

From   Patricia Biedermann <>
Subject   st: copying contents form existing to new variable
Date   Wed, 24 Apr 2013 11:10:10 +0200

Dear all,

If I generate a new variable from an existing variable it happens that
the contents get changed.
gen var2=var1

My approach is following:
1) My original variable is string and I - encode - it: var1
2) gen var2=var1

At step 2) the contents changes.
I came along this Thread:
..and tried to create a double variable first before copying the
variables. Anyway, the same problem appears again.

What could be the problem? It did this thing (gen var2=var1) many
times and it always worked so far...

Thanks a lot.
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index