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: Summarize data

 From Patricia Biedermann <[email protected]> To [email protected] Subject Re: st: Summarize data Date Sat, 9 Jun 2012 13:23:49 +0200

```Hello!
Thank you for your answer!

I tried this command:

egen row_mean = rowmean(Q1A Q2A Q3)
list Q1A Q2A Q3A

but I just get a table and I need actual values.  and how do I sort it
by groups? (if group==1 ????)

Sorry, I'm still quite new to STATA but I'm glad for any help!

Thank you.

On Fri, Jun 8, 2012 at 8:30 PM, Nick Cox <[email protected]> wrote:
> -egen- offers a bundle of functions (in its own sense) for summarising
> rowwise. You can apply -if- and/or -in-.
>
> Nick
>
> On Fri, Jun 8, 2012 at 5:46 PM, Patricia Biedermann <[email protected]> wrote:
>
>> I need to summarize data in the following way:
>>
>> My questionnaire looks like that:
>>
>> Question 1     option1           option2           option3 (options
>> are numeric 1-5)
>>
>> Question 2
>>
>> Question 3
>>
>> Etc. (up to 16 question in  the same structure)
>>
>> The database in Stata looks like that:
>>
>> ID        Q1A     Q1B     Q1C     Q2A     Q2B     Q3B     …ETC  (GROUP)
>>
>> Respectively option1 of question 1 represents Q1A
>
>> Now I want to summarize the data of all questionnaires in that way:
>>
>> -       summarize (mean) option 1 for ALL QUESTIONS AND ALL
>> questionnaires (mean of Q1A, Q2A, Q3A,...etc)
>>
>> -       summarize (mean) option 2 etc…(mean of Q1B, Q2B, Q3B,...etc)
>>
>> So, maybe the solution is simpler then I think or my database is
>> crap…but can anyone help me to figure out the right commands? (I
>> already tried sum and collapse commands...)
>>
>>  Is there also a possibility to summarize it by grouping (same
>> questionnaires, but e.g. different location of interview…)
>
> *
> *   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?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