Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Creating an id variable from one of each (string) observations in 6 variables


From   Jonas Klarin <[email protected]>
To   [email protected]
Subject   st: Creating an id variable from one of each (string) observations in 6 variables
Date   Thu, 20 Mar 2014 11:05:08 +0100

Dear all,

I have election survey data from six periods in time. In each point in time, a couple of thousand different people answered a question. The answers are stored in six string variables as text. I would like to create an id variable containing each unique answer from the six variables and then count the number of times each unique answer is recorded for every time period. In other words, I would like to know how many times the respondents replied eg. Syssels% for every time period (variable). Can someone help me with this?

The data looks like this (IIxxxx are the variable names):

II1994		II1998		II2002		II2006		II2010		II1991
Syssels‰	Syssels‰	.			Syssels‰	.			.	
Familjep		KulturfrÂgor	.			.			.			.
Sveriges		SjukvÂrd		H‰lso- o		Miljˆ/miljˆv		.			.
.			.			SjukvÂrd/sju	.			.			.
.			.			SjukvÂrd		ƒldrevÂr		Skatter/arbe	.
…			…			…			…			…			…	

etc.. 


Kind regards,
Jonas Klarin
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index