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
Probit Analysis ErrorDear Stata Community, I am trying to run the Probit command with many DVs for different years, I k…
95% BCa confidence interval for Cramers V with negative values - why?Hello, I tried to get a 95%-CI for Cramers V I calculated using the tabulate-command. I used bootst…
"#delimit ;" combined with "*" produces no outputHello everyone I have a very simple frustrating problem, for which I found a solution I don't under…
Does a dynamic forecast from a VAR model with exogenous variables consider the values of the exogenous variables in its first forecastHi I have a VAR model with 4 endogeous variables, 2 exogenous variables and 1 lag. The code is as …
Loop going through distinct values of variable1 and replacing distinct string in variable2 per each iterationHi all, I have this kind of reproducible code: Code: clear set obs 10 gen str names = "" gen num…
Subscribe to:
Post Comments (Atom)
0 Response to Trying to replace a variable with a new generated variable
Post a Comment