Skip to content
Prev 318556 / 398506 Next

Conditional Weighted Average (ddply or any other function)

Well the normal assumption here is to assume that Excel is wrong. I am not joking. Spreadsheets are notoriously error-prone, especially Excel, from problems with basic algorithms to 'simple' problems such as typos or accidentally specifying the wrong column of data. 

See http://www.r-bloggers.com/spreadsheet-errors/ [http://www.r-bloggers.com/spreadsheet-errors/] for one nasty example or from a recent thread on Excel and R 
"The idea that the Excel solver "has a good reputation for being fast and accurate" does not withstand an examination of the Excel solver's ability to solve the StRD nls test problems. Solver's ability is abysmal. 13 of 27 "answers" have zero accurate digits, and three more have fewer than two accurate digits -- and this is after tuning the solver to get a good answer. 
...
Excel solver does have the virture that it will always produce an answer, albeit one with zero accurate digits."
Bruce McCullough 

On the other hand there can be any number of reasons why R and Excel are not giving the same results assuming Excel may be correct. 

One thing that come to mind is that R and Excel may be handling missing data in a different manner if you have any missing data. 

Otherwise you may need to break out some data were the combination a)works with some combinations and does not with others and let some experts have a look at it. 

To my untutored eye you look like you're okay but I am not an expert by any means.

Sorry not to be of more help

John Kane
Kingston ON Canada
____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!