I have a dataset with surey respondents' congressional districts and their traits. I want to create a set that matches the traits with thedistrics. But the districts are string and do notmatch the traits. I tried to create a numeric variable for the districts ut continually got the message of a type mismatch since I cannot convert a string to a numericl Is there a way to make this conversion? Here is the example:
and any help would be appreciated.
Ric Uslaner
. dataex cd1
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
Listed 100 out of 486 observations
Use the count() option to list more
.
and any help would be appreciated.
Ric Uslaner
. dataex cd1
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str5 cd1 "AL-01" "AL-02" "AL-03" "AL-04" "AL-05" "AL-06" "AL-07" "AK-AL" "AZ-01" "AZ-02" "AZ-03" "AZ-04" "AZ-05" "AZ-06" "AZ-07" "AZ-08" "AZ-09" "AR-01" "AR-02" "AR-03" "AR-04" "CA-01" "CA-02" "CA-03" "CA-04" "CA-05" "CA-06" "CA-07" "CA-08" "CA-09" "CA-10" "CA-11" "CA-12" "CA-13" "CA-14" "CA-15" "CA-16" "CA-17" "CA-18" "CA-19" "CA-20" "CA-21" "CA-22" "CA-23" "CA-24" "CA-25" "CA-26" "CA-27" "CA-28" "CA-29" "CA-30" "CA-31" "CA-32" "CA-33" "CA-34" "CA-35" "CA-36" "CA-37" "CA-38" "CA-39" "CA-40" "CA-41" "CA-42" "CA-43" "CA-44" "CA-45" "CA-46" "CA-47" "CA-48" "CA-49" "CA-50" "CA-51" "CA-52" "CA-53" "CO-01" "CO-02" "CO-03" "CO-04" "CO-05" "CO-06" "CO-07" "CT-01" "CT-02" "CT-03" "CT-04" "CT-05" "DE-AL" "FL-01" "FL-02" "FL-03" "FL-04" "FL-05" "FL-06" "FL-07" "FL-08" "FL-09" "FL-10" "FL-11" "FL-12" "FL-13" end
Listed 100 out of 486 observations
Use the count() option to list more
.

Comment