Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Combining two numerical variables.

    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

  • #2
    Hello, welcome to Statalist.

    I just want to let you know that homework questions are usually not answered (see https://www.statalist.org/forums/help#adviceextras at the bottom.) Generally, most forums have some policies against asking help for homework. I'd suggest you to consult your course director or teaching assistant, etc. for more tailored support.

    Here are a couple pointers:
    1. Use the codebook and find out how these two variables are coded in the survey. They recorded actual monetary cost, but also have special codes for occasions such as "included in rent" as 9996. And that is not $9996.
    2. In Stata, to compute the sum, look into "generate". You can get the technical document by submitting the command "help generate".

    Comment

    Working...
    X