Statalist The Stata Listserver


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

st: RE: Reshape problem


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Reshape problem
Date   Fri, 5 May 2006 10:37:03 -0500

In addition to Nick's suggestion of using -sxpose-, the following uses Mata
to transpose the data and Ben Jann's -mm_outsheet- (part of -moremata-)


clear
tempfile tmp1
input str16 v1  str2 v2  str2 v3  str2 v4 
             "Sex"    M    M    M 
             "Age"   47   66   56 
        "Left eye"                
       "Right eye"    Y    Y    Y 
    "Lower eyelid"    Y    Y    Y 
    "Upper eyelid"                
 "Lateral canthus"                
  "Medial canthus"    Y    Y      
"Recurrent lesion"                
  "Primary lesion"    Y    Y    Y 
end
l

mata
    A = st_sdata(.,.)'
    mm_outsheet("`tmp1'",A, mode="r")
end
insheet using "`tmp1'",clear
l, ab(15) noobs


Scott



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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