(Unfortunately, I lack the basic vocabulary to formulate my question. Therefore, please correct me where more precise terms are useful.)
I use R to do a very simple statistical analysis for virtual machine test results, and I often want to normalize my data based on some criterion.
My current problem is that I would like something like the following:
normalized_data <- ddply(bench, ~ Benchmark + Configuration + Approach, transform, Ratio = Time / Time[Approach == "appr2"])
So, I really want to calculate the acceleration between the corresponding pairs of measurements.
bench is a data frame with columns Time, Benchmark, Configuration and Approach and contains 100 measurements for all possible combinations of Benchmark, Configuration and Approach. Now I have exactly two approaches and you want to speed up "appr2" / "appr1". Thus, just looking at one specific landmark and one specific configuration, I have 100 dimensions for "appr1" and 100 "appr2" in my data frame. However, R gives me the following error resulting from the request:
Error in data.frame(list(Time = c(405.73, 342.616, 404.484, 328.742, 403.384, : arguments imply differing number of rows: 100, 0
Ideally, the result of my query will lead to the creation of a new data frame with three columns SpeedUp, Benchmark, Configuration. Based on this, I could calculate the means, confidence intervals, etc.
But at the moment, the main problem is how to express such a normalization. For another dataset, I was able to calculate a normalized value similar to this Time.norm = Time / Time[NumCores == min(NumCores)] , but it looks like it worked by chance, at least I don’t understand the difference.
Any clues. (Especially correct terminology for finding solutions to such problems.)
Edit: thanks to the Chase hint, here is a minimal data set that should be structurally identical to what I received, and it exhibits the same behavior with respect to the above query.
bench <- structure(list(Time = c(399.04, 388.069, 401.072, 361.646), Benchmark = structure(c(1L, 1L, 1L, 1L), .Label = c("Fibonacci"), class = "factor"), Configuration = structure(c(1L, 1L, 1L, 1L), .Label = c("native"), class = "factor"), Approach = structure(c(1L, 1L, 2L, 2L), .Label = c("appr1", "appr2"), class = "factor")), .Names = c("Time", "Benchmark", "Configuration", "Approach"), row.names = c(NA, 4L), class = "data.frame")