Hello,
I would like to rename a variable (suppose it's name is VAR) with the content that is in a specific observation (let's say A[3] has the name of a city).
So, I want he name of VAR to be the name of the city in A[3].
My only idea was the following command:
rename (VAR) (A[3])
I know that to replace the content of VAR with the content of A[3] I can use
replace VAR = A[3]
But I want the name of VAR equal to the content of A[3].
Can someone help me?
Related Posts with Rename a variable with content
estat and fitstat show different BICI want to get the AIC and BIC after fitting a model, but recently I found that estat and fitstat sho…
Reshape Data panel to wideHi everyone, I struggle to reshape my panel data to wide. The idea is to start from this: Code: …
how to remove certain value?Hello! I'm a new STATA user and I have a variable like this: Physical activity 3 4 3 2 0 How can …
compare value different variable and rowshello, I want to compare values of two varible in diffrent rows. For example vr1 vr2 10 20 20 30 40 …
Proportional redistributionI have a dataset with a variable sex (male, female, unknown), I want to create a new variable that w…
Subscribe to:
Post Comments (Atom)
0 Response to Rename a variable with content
Post a Comment