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

# Re: st: Paired t-test for propensity match cohort

 From Lars Folkestad To "statalist@hsphsun2.harvard.edu" Subject Re: st: Paired t-test for propensity match cohort Date Tue, 19 Jul 2011 09:12:18 +0200

```Hmm
Im not sure.
How about using the matching variable as the grouping variable and the pairs
variable as the id variable in the reshape command:

Reshape wide age var2 var3 var4 ... VarN, i(pairs) j(matching_Variable)

That gives you something like this:
Pair age0 age1
1   53     54
2   55      52
3   55     52
4   53      54

If you have a variable that is supposed to be equal within the pairs eg: Sex
You can use the following command:
Assert sex0==sex1

Hope that helps
lars

Den 17/07/11 18.53 skrev "Sripal Kumar" <sripalkumar@gmail.com> følgende:

> Thanks Lars. I dont think this helps.  In essence, what I need is the
> mean age (and the test for significance) in the matching_Variable 0
> when compared with the mean age in matching_Variable 1, stratified by
> matched pairs (Pairs).  The below example is after propensity score
> matching with pairs 1, 1 forming a pair and so forth.  The simple
> solution would be to create age_0 (age for the matching_Variable 0 for
> pair 1) and age_1 (age for the matching_Variable 1 for pair 1), so
> that the row for pair 1 would have 2 columns for age. However, my
> dataset has around 10,000 cases and the above is not easy to do. Any
> thoughts? I hope I have made myself clear.
>
> Pairs               matching_Variable              Age
> 1                           0                                    53
> 1                           1                                    54
> 2                           0                                    55
> 2                           1                                    52
> 3                           0                                    55
> 3                           1                                    52
> 4                           0                                    53
> 4                           1                                    54
> 5                           0                                    55
> 5                           1                                    52
>
>
>
>
>
>
>
> On Sun, Jul 17, 2011 at 12:06 PM, Lars Folkestad
>> If you sort group and age and use the stable option you can reshape your data
>> using the reshape wide option
>> The stable option is critical.
>> Tjeck you data one million times when you have reshaped your data, so that
>> pair 1 is a line. (there is a funktion in Stata that can do the checking for
>> you, but cannot remember the name of it.)
>>
>> Then do ttest varex1 == varex2
>>
>> Hope it helps, and that i havent misunderstood your problem.
>>
>> Mvh
>>
>>
>> Den 17/07/2011 kl. 17.26 skrev "Sripal Kumar" <sripalkumar@gmail.com>:
>>
>>> Dear all,
>>>
>>> There should be a simple solution to the problem below but I cant seem
>>> to wrap my head around it. I have a propensity matched cohort that is
>>> arranged as
>>>
>>> Pairs               matching_Variable              Age
>>> 1                           0                                    53
>>> 1                           1                                    54
>>> 2                           0                                    55
>>> 2                           1                                    52
>>> 3                           0                                    55
>>> 3                           1                                    52
>>> 4                           0                                    53
>>> 4                           1                                    54
>>> 5                           0                                    55
>>> 5                           1                                    52
>>>
>>> How can I do a paired sample t-test for age without having to create
>>> two other variables age_0 and age_1.
>>> thanks in advance.
>>> Sripal.
>>>
>>> *
>>> *   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/
>>
>
> *
> *   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/

--
Læge, PhD-studerende
Endokrinologisk Afdeling M / Endokrinologisk afdeling / Klinisk Institut
Odense Universitets Hospital / Sydvestjysk Sygehus Esbjerg / Syddansk
Universitet

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