Hello,
I am trying to replace a variable so that when I create a graph for GDPpc it shows GDPpc below 20k and above 30k. the starting gdp variable is gdppc
I used: 'generate code_gdppc2 = "" ' to make a string variable, then:
replace code_gdppc2 = code_gdppc if gdppc < 20000
However, when this is run it says 0 real changes made and I cannot for the life of me figure out why.
or to get my desired result I run:
'replace code_gdppc2 = code_gdppc if gdppc < 20000 & gdppc > 30000'
and this says 'code_gdppc ambiguous abbreviation'
what is the way around this?
Apologies if this is classed as an elementary question, I am new here and have no other place to turn for an answer.
Thank you.
Related Posts with Trying to replace a variable with a new generated variable
psmatch2 and teffects psmatchI have a question, how can I get the pscore delivered by psmatch2 command automatically, but using t…
Advice on Reshaping/Collapsing Data on Resident Stays to a Dataset on Facility OccupancyDear all, I am working with nursing home data, and would greatly appreciate some advice on how to e…
Sankey visual analysisHi, I am trying to use Sankey to visually describe longitudinal patterns/flow in Stata 17. (I have …
Getting rid of unwanted missing value in a variableHi, I have the following variable "coeff" Code: * Example generated by -dataex-. To install: ssc …
mixed: How do I retrieve the intercept-slope correlation?Hi I am fitting a model like this: Code: webuse nlswork, clear mixed ln_w tenure || id: tenure, …
Subscribe to:
Post Comments (Atom)
0 Response to Trying to replace a variable with a new generated variable
Post a Comment