Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Date: Fri, 20 May 2005 11:16:47 +0200


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Date: Fri, 20 May 2005 11:16:47 +0200
Date   Fri, 20 May 2005 12:01:06 +0100

You have the basic information in the variable 
you call -content-. The most direct attack 
I can think of is to -recode- to fewer categories. 
Something like this: 

recode content (1 2 = 2) (4 5 = 4), gen(content2) 
tab content2 

Nick 
n.j.cox@durham.ac.uk 

Sinha, Ashish

> This is part of an extremely convoluted code I wrote in an attempt to
> process some data.  On an excel file there is a question about the
> lesson content of a course.  The participants had the option of
> answering this question with five answers (strongly agree, agree,
> neither, disagree, strongly disagree).  I am attempting to find the
> percentages of participants who generally agree, are neutral, or
> disagree. Any help or suggestions would be greatly appreciated!
> 
> Lessontontent~o is the name of the variable from excel that 
> corresponds
> to the data 
> 
> 
> 
> label data "Response Data"
> label define content 1 "Strongly   agree" 2 "Agree" 3 "Neither agree
> nor disagree" 4 "Disagree" 5 "Strongly   disagree"
> encode lessoncontent~o, gen(content) 
> drop if missing(content)
> g agree = 1 if (content == 1) | (content == 2) 
> tabulate agree
> g neutral = 2 if (content == 3)
> tabulate neutral
> g notagree = 3 if (content == 4) | (content == 5) 
> tabulate notagree
> g lessoncontent = agree & neutral & notagree
> tab lessoncontent

*
*   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