Announcement

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

  • tab2xl command only saving zeroes

    Hi. I was looking to export some cross-tabulations to excel and I came across -tab2xl-. The command does exactly what I need it to do, so I wrote a bunch of code using it. The thing is (after I did some tests and it worked properly), that after running a piece of code, and no errors happen, the excel created only contains a matrix of zeroes where the data should appear. Can anyone please explain why is this happening? This is the code I am running:
    Code:
    tab2xl reufin2013aprueba reucon2013aprueba using reufin_y_reucon2013, row(1) col(1) sheet("aprycond", replace) replace
    tab2xl reufin2013condicion reucon2013condicion using reufin_y_reucon2013, row(12) col(1) sheet("aprycond", replace)
    All 4 variables are str1. I thought it could be a problem but I am puzzled since it did work a few times!

    Thanks very much in advance.

  • #2
    You didn't get a quick answer. You'll increase your chances of a helpful answer by following the FAQ on asking questions. While you provide Stata code, you might also provide Stata output and sample data using dataex. If it worked a few times and then didn't

    The documentation says " Note: Tab2xl does not support strings in two-way form, and will return an error code before opening
    or altering the file, leaving it untouched." So when it seemed to work you probably didn't have string variables.

    If it really did work for string variables, I'd first make sure the cross-tab works without tab2xl on precisely the variables and observations that give you problems. If it works, then your problem is in tab2xl. However, it is very hard to diagnose this without the data and output. If you can get tab2xl to work for a very simple case, then add one addition option at a time.

    Comment

    Working...
    X