Announcement

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

  • -table- and -putexcel-: How to add a coloumn

    My data is individuals who have graduated, and I have data on whether they are unemployed. I wish to make a table showing the percentage of graduates being unemployed by year and export that to excel. Variable 'gradyear' shows the graduation year of the individual and variables unempl1, unempl2, unempl3, and unempl4 show employment status 1, 2, 3 and 4 years after graduation, '1' being unemployed.

    Making the table for 1 year after graduation is simple:
    Code:
    putexcel set results, sheet(unemp) modify
    table gradyear, stat(mean unempl1)
    putexcel a1=collect
    What I want to do is have the 2. coloumn showing percentage unemployed 2 years after graduation, 3 coloumn 3 year after graduation and so on, i.e., all years after graduation in one table. My intution is:
    Code:
    putexcel set results, sheet(unemp) modify
    table gradyear, stat(mean unempl1)
    table gradyear, stat(mean unempl2) append
    ...but this returns "Your layout specification does not uniquely match any items. One or more of the following dimensions might help uniquely match items: cmdset, colname, var."

    Can anyone help here?

    My data looks something like this:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte(gradyear unempl1 unempl2 unempl3 unempl4)
    1 1 0 1 0
    2 1 0 1 1
    2 1 0 1 0
    3 1 1 0 1
    4 0 1 0 0
    2 0 1 1 1
    1 0 0 0 0
    2 0 0 1 1
    3 0 0 0 0
    4 1 1 1 1
    end
Working...
X