I am trying to collapse three (ultimately more) variables on zip codes, state names, and Congressional districts from a survey data set. (I tried to upload the data set but was told that it was not a viable image??). Here are the variables and the first 5 lines of data:
. des lookupzip inputstate cdid115
storage display value
variable name type format label variable label
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lookupzip str5 %-9s Zip code used for CD mapping
inputstate double %10.0g inputstate
State of Residence
cdid115 str2 %-9s CD 115th Congress
and
. clist lookupzip inputstate cdid115 in 1/5
lookupzip inputstate cdid115
1. 77087 Texas 29
2. 45039 Ohio 1
3. 40222 Kentucky 3
4. 85018 Arizona 9
5. 16335 Pennsylvan 3
I converted lookupzip and cdid115 to numeric--and that worked fine, but when I collapsed the variables the state codes were all numeric and I got the message that inputstate had no value labels.
There must be a way to get this done, but I don't know it. If you want the data set, email me (euslaner@umd.edu) and I will send it to you. Many thanks,
Ric
Related Posts with Collapse using both string and alphanumeric
Show estimates for identical variables next to each other (e.g. via esttab)I have several models with (three-way) interactions terms, some of them are manually coded. I am sea…
For-loops are killing me!I created a postfile and now trying to display the results from that postfile. There are two variabl…
New v17 features in Mata?This thread initiated recently by Joseph Coveney calls attention to one of the new date functions in…
Multilevel analysis for longitudinal effectsDear Community, I am working with the European Working Conditions Survey and I would like to calcul…
Comparing the seasonal naive method with Holt-Winters' additive seasonal exp. smoothing method using ts cross-validationHello, I am having trouble figuring out the correct commands when I try to compare the seasonal nai…
Subscribe to:
Post Comments (Atom)
0 Response to Collapse using both string and alphanumeric
Post a Comment