Kristina Loderer
2015-Mar-09 17:40 UTC
[R] SPSS command "match files" for merging one-to-many (hierarchical) equivalent in R?
Dear R community, to combine data sets of hierarchical, nested nature (i.e., data sets linked by, for example, the variable "study ID" and then also by "outcome_variable_1" and "outcome_variable_2") I can use the match files command in SPSS. What is the equivalent command / function in R? Is it the merge function, or the match function? The more I read, the more confused I become.. Thank your for help in advance! Kristina Loderer ----------------------------------------- Kristina Loderer Ludwig-Maximilians-Universit?t M?nchen Department Psychologie Leopoldstr. 13 D-80802 M?nchen Telefon: +49 (89) 2180-6047 Email: Kristina.Loderer at psy.lmu.de -----------------------------------------
Duncan Murdoch
2015-Mar-09 18:53 UTC
[R] SPSS command "match files" for merging one-to-many (hierarchical) equivalent in R?
On 09/03/2015 1:40 PM, Kristina Loderer wrote:> Dear R community, > > to combine data sets of hierarchical, nested nature (i.e., data sets > linked by, for example, the variable "study ID" and then also by > "outcome_variable_1" and "outcome_variable_2") I can use the match files > command in SPSS. What is the equivalent command / function in R? Is it > the merge function, or the match function? The more I read, the more > confused I become.. >I don't know SPSS at all, so I can't help you. If nobody else does, you might try putting together a tiny example in R showing what you're starting with, and what you want to produce. From what you wrote, I'd guess merge(), not match(), but you might really be asking for something completely different. Duncan Murdoch
Marc Schwartz
2015-Mar-09 18:58 UTC
[R] SPSS command "match files" for merging one-to-many (hierarchical) equivalent in R?
> On Mar 9, 2015, at 1:53 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > > On 09/03/2015 1:40 PM, Kristina Loderer wrote: >> Dear R community, >> >> to combine data sets of hierarchical, nested nature (i.e., data sets >> linked by, for example, the variable "study ID" and then also by >> "outcome_variable_1" and "outcome_variable_2") I can use the match files >> command in SPSS. What is the equivalent command / function in R? Is it >> the merge function, or the match function? The more I read, the more >> confused I become.. >> > > I don't know SPSS at all, so I can't help you. If nobody else does, you might try putting together a tiny example in R showing what you're starting with, and what you want to produce. From what you wrote, I'd guess merge(), not match(), but you might really be asking for something completely different. > > Duncan MurdochBased upon the info here: http://www.ats.ucla.edu/stat/spss/modules/merge.htm I would go with ?merge, since the desired functionality appears to be a relational join operation. Regards, Marc Schwartz