I am using the American commuinty survey dataset and I have two numerical variables COSTELEC "annual cost of electricity" and COSTFUEL "annual cost of heating". I would like to combine these two variables for every household in the set and use them as one variable, but I have no clue how to do that.
Also after combining them, I would like to estmiate the proportion of that new variable "energy costs" from another variable HHINCOME "Annual income".
I would appreciate the help I am a beginner and I have this stata assignement for my final and I am struggling to get it done.
Thank you
Related Posts with Combining two numerical variables.
Combine a bunch of dummy variables into a multinomial/categoricalIt is trivial to convert a categorical variable into a bunch of dummy variables. I would like to do…
Log function within loopsHello Stata experts, I am trying to perform a log function within loops, but it gives me errors tha…
How to replace the newline/nextline character in a column with space characterHello! I understand that subinstr can be used to replace a substring in a column https://www.stata.…
Adding month observations to year level dataHi, I am working with the following variables: Code: * Example generated by -dataex-. For more info…
How to calculate date_month variable from Date (dmy) and day of year (doy)Hi, I have been wondering if there is a way to present average annual statistics from time-series d…
Subscribe to:
Post Comments (Atom)
0 Response to Combining two numerical variables.
Post a Comment