I have a dataframe organized as follows:
Variable 1 | Variable 2 | Variable 3 | Outcome Variable
---------- | ---------- | ---------- | ----------------
Factor | Factor | Factor | Outcome
for a few thousand rows, 15 variable columns, and 1 output column. I would like to summarize the table (preferably using plyr) in the following long format:
Variable 1 | Variable 2 | Variable 3 | Outcome Variable
---------- | ---------- | ---------- | ----------------
Factor 1 | Factor 1 | Factor 1 | Average Outcome
Factor 1 | Factor 1 | Factor 2 | Average Outcome
Factor 1 | Factor 2 | Factor 1 | Average Outcome
Factor 1 | Factor 2 | Factor 2 | Average Outcome
for different variable combinations. What is the easiest way to do this?