Re: [R] matched pairs

2011-07-23 Thread Ellen S.
Thanks everyone! I finally got some code to work (thanks to William Dunlap). -- View this message in context: http://r.789695.n4.nabble.com/matched-pairs-tp3687506p3687864.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-projec

Re: [R] matched pairs

2011-07-22 Thread William Dunlap
wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Ellen S. > Sent: Friday, July 22, 2011 10:02 AM > To: r-help@r-project.org > Subject: [R] matched pairs > > Hi all, > > I am hopin

[R] matched pairs

2011-07-22 Thread Ellen S.
Hi all, I am hoping to keep certain rows of my data set. These are rows whose value in column X is equal to the value in column X for another row. For example: 1 1 2 1 3 2 4 3 5 4 6 4 >From this I would want the following: 1 1 2 1 5 4 6 4 I am struggling with the for loop. Here is wh

Re: [R] Matched pairs with two data frames

2008-04-20 Thread Udo
David, tkanks für your comment, the code and the link. You are right: "arbitrary" is a better word than "exact" pair matching. I took the term "one-to-one exact matching" from the paper "MatchIt: Nonparametric Preprocessing for Parametric Causal Inference" (p. 6): http://gking.harvard.edu/matchit

Re: [R] Matched pairs with two data frames

2008-04-20 Thread ukoenig
Thank´s a lot, Patrick! That´s what I was looking for... Zitat von Patrick Connolly <[EMAIL PROTECTED]>: > On Wed, 16-Apr-2008 at 11:58AM +0200, Udo wrote: > > > |> I only "need" line 1, 6 and 9. To show this, > |> I added "needed" by hand. > |> > |>age school out1 out2 needed > |> 1

Re: [R] Matched pairs with two data frames

2008-04-18 Thread David Winsemius
Udo <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Daniel, > thank you! > > I want to perfrom the simplest way of matching: > a one-to-one exact match (by age and school): > for every case in "treat" find ONE case (if there is one) in > "control" . The cases in "control" that could be ma

Re: [R] Matched pairs with two data frames

2008-04-18 Thread Patrick Connolly
On Wed, 16-Apr-2008 at 11:58AM +0200, Udo wrote: |> I only "need" line 1, 6 and 9. To show this, |> I added "needed" by hand. |> |>age school out1 out2 needed |> 11 10 9.5 1.1 yes |> 21 10 9.5 2.0 no |> 31 10 9.5 3.5 no |> 4

Re: [R] Matched pairs with two data frames

2008-04-17 Thread Udo
ioned > question is yes, there is a reason, then we would need to know the criteria > on which to base the coding for this variable. What makes a yes a yes and a > no a no? > > Cheers, > Daniel > > > > > - > cuncta stricte discussurus > ---

Re: [R] Matched pairs with two data frames

2008-04-16 Thread Daniel Malter
Gesendet: Wednesday, April 16, 2008 5:59 AM An: r-help@r-project.org Betreff: Re: [R] Matched pairs with two data frames Patrick, my intention was, to perform a one-to-one exact match, which pairs each treated unit with ONE control unit (without replacement), using my two confounders (age, school

Re: [R] Matched pairs with two data frames

2008-04-16 Thread Udo
Patrick, my intention was, to perform a one-to-one exact match, which pairs each treated unit with ONE control unit (without replacement), using my two confounders (age, school) for matching. Patrick Connolly schrieb: On Mon, 14-Apr-2008 at 08:37AM +0200, Udo wrote: |> Zitat von Peter Alspach <[

Re: [R] Matched pairs with two data frames

2008-04-14 Thread Patrick Connolly
On Mon, 14-Apr-2008 at 08:37AM +0200, Udo wrote: |> Zitat von Peter Alspach <[EMAIL PROTECTED]>: |> |> > Udo |> > |> > Seems you might want merge() |> > |> > HTH ... |> > |> > Peter Alspach |> |> Thank you Peter and Jorge, |> |> but as I had written in my last sentence, |> "Merge doesn´t do

Re: [R] Matched pairs with two data frames

2008-04-13 Thread Udo
;, but maybe there is a sophisticated solution with "merge", I could not bring light to. Udo > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Udo > > Sent: Monday, 14 April 2008 6:41 a.m. > > To: r-h

Re: [R] Matched pairs with two data frames

2008-04-13 Thread Jorge Ivan Velez
Hi Udo, Perhaps > merge(treat,control) does what you need. I hope this helps, Jorge On Sun, Apr 13, 2008 at 2:41 PM, Udo <[EMAIL PROTECTED]> wrote: > Hi, > I have a frame "treat" and want to find matched pairs in the data frame > "control". In the matched (combined) data frame there should

Re: [R] Matched pairs with two data frames

2008-04-13 Thread Peter Alspach
Udo Seems you might want merge() HTH ... Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Udo > Sent: Monday, 14 April 2008 6:41 a.m. > To: r-help@r-project.org > Subject: [R] Matched pairs with two data f

[R] Matched pairs with two data frames

2008-04-13 Thread Udo
Hi, I have a frame "treat" and want to find matched pairs in the data frame "control". In the matched (combined) data frame there should be two variables (0/1),indicating the "source" of the data (treat or control), so that it is possibe to set a "filter" (extraxt/select data). #Here are the dataf