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]

Re: st: tabout for multiple likert-scale questions


From   Vicki Livingstone <[email protected]>
To   [email protected]
Subject   Re: st: tabout for multiple likert-scale questions
Date   Mon, 27 Sep 2010 11:09:19 +0000 (GMT)

Hi Eric,

Many thanks for that - It works perfectly once none of the questions have a 
category where the frequency is zero.
 
Suppose that there were only two questions and the data was as follows:
Q1 Q2
1 2
2 5
4 1
1 1
5 1
3 3
 
 When you run the syntax, you get the following output:    
 
question        1       1       2       2       3       3       4       4       
5       5       Total   Total
 Frequency       Percent Frequency       Percent Frequency       Percent 
Frequency       Percent Frequency    Percent Frequency       Percent
Q1      2       33%     1       17%     1       17%     1       17%     1       
17%     6       100%
Q2      3       50%     1       17%     1       17%     1       17%     6       
100%
 
Is there a way to include categories with zero observed frequency using tabout?

Thanks again, 
Vicki 



----- Original Message ----
From: Eric Booth <[email protected]>
To: "<[email protected]>" <[email protected]>
Sent: Sat, 25 September, 2010 18:21:29
Subject: Re: st: tabout for multiple likert-scale questions

<>


**************************!
clear
set obs 200
forval n = 1/5 {
    g Q`n' = 1+int((7-1+1)*runiform())
    }

gen question="Q1"

**Q1**
tabout question Q1 using table1.xls, replace cell(freq row) format(0c 0p) ///
clab(Frequency Percent) ptotal(none) h1(| Likert Scale Questions)
drop question

**Q2 - Q5**
forval n = 2/5 {
preserve
    keep Q`n'
gen question="Q`n'"
tabout question Q`n' using table1.xls, append cell(freq row) format(0c 0p) ///
ptotal(none) h1(nil) h2(nil) h3(nil)
restore
}
**************************!

- Eric
__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]
Office: +979.845.6754


On Sep 25, 2010, at 3:19 AM, Vicki Livingstone wrote:

> Hi all,
> 
> I am running descriptives for a questionnaire that has many questions measured 




> on the same Likert scale. What I would like to output is a table where 
> the rows correspond to each question and the columns are the n(%) for 
> each category of response within the question.
> 
> Using the following commands, I can output the results for an individual 
> question. 
> gen new=1
> tabout new Q1 using table1.xls, replace cell(freq row) format(0 0) 
> clab(Frequency Percent)
> 
> Is there a way of including all Likert questions in the output?
> 
> Many thanks in advance, 
> Vicki Livingstone
> 
> 
> 
> 
> 
> *
> *  For searches and help try:
> *  http://www.stata.com/help.cgi?search
> *  http://www.stata.com/support/statalist/faq
> *  http://www.ats.ucla.edu/stat/stata/




*
*  For searches and help try:
*  http://www.stata.com/help.cgi?searchhttp://www.stata.com/support/statalist/faqhttp://www.ats.ucla.edu/stat/stata/



      


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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