Stata can import excel files, but it assumes that the variable names in the column headers are unique and appear in a single row. The attached file is an exception. It gives the number of children in a sample of about 50 schools who are malnourished, underweight, normal, overweight, or suffer from obesity or severe obesity. These column headers are in row 2 and they repeat: the headers for columns B-G are the same as for columns H-M. The difference is that columns B-G refer to boys and columns H-M refer to girls -- but this is only clear from the merged cells in row 1.
When column labels are split across two rows this way, is there any convenient way to import them as variable names? It would be great if they came through as boys_malnourished, girls_malnourished, etc.
I can edit the column labels to be unique, but that's not convenient since in my real data there are more files and more columns....
Thanks for any ideas!
Best wishes,
Paul
Related Posts with import excel with two-row headers
Difference between a classical DID and panel regression wrt interaction termDear Stata Members I have a question related to the interpretation and choosing the right model. Let…
Help correlating between parameters across tasks and participantsHello everyone, This question may be rudimentary, however I haven't touched statistics for a very lo…
Rank with a ConditionHello, I am stuck trying to rank a variable conditionally.....I understand rank is an egen function…
Multiple imputation estimate excluding some imputationsHi everyone, I would like to run the following code on my imputed dataset: Code: foreach var in $l…
What should we conclude when the Adjusted R square decrease when adding a dummy variable into the regression?In my regression using OLS, when I add a dummy variable into my regression, the Adjusted R-squared r…
Subscribe to:
Post Comments (Atom)
0 Response to import excel with two-row headers
Post a Comment