Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: xpose problems

Subject   st: xpose problems
Date   Thu, 01 Jun 2006 09:15:31 -0500

I’m having a problem with the xpose command.

I have two datasets – one from 1996 and one from 2000 that are similar.  I stat transferred them from excel into stata (they are too large for Excel to transpose). 

For 1996, the original dataset had 916 rows and 935 columns.  When I transpose the matrix, I get 767 rows instead of 935.  I thought perhaps this was because in the original data, the missing 168 entries contain only 0’s.  Perhaps STATA eliminates them in the xpose process?  It adds up.

However, when I do the exact same thing with the 2000 data, I start with 847 rows and columns and end with the same number, despite having 231 columns of 0’s in the original data.  I found out that the 0 columns are of data type “byte” in both datasets.  This makes me question my original hypothesis for the 1996 data and wonder why it would drop those columns in one instance and not in another.

Here is my program (commid is a string that essentially is my identification for the entries)

use 00total3b.dta, clear
rename commid _varname
xpose, clear varname
rename _varname commid

save 00totalnew.dta

**New Email:
Monica C. Schneider
PhD Candidate
Department of Political Science
University of Minnesota, Twin Cities
1414 Social Sciences
267 19th Ave South
Mpls, MN 55455
**New Email:

© Copyright 1996–2022 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index