[R] model construction

From: Daniel Dunn <daniel_at_dunncapital.com>
Date: Wed, 13 Feb 2008 11:57:13 -0500


I buy flowers at a local market on a fairly regular basis. The flower vendors post their prices and if I want to buy only one or two flowers I will generally get the posted price. From time to time I want to buy large quantities of flowers, and sometimes a vendor will give me a better price than their posted price for the bulk order, but more often I have to offer them a higher price than the posted price to get my desired quantity. I have collected the outcome of several thousand visits to the flower market and I want to analyze whether there is any relationship between the amount of flowers I am buying and the 'average' increment above the posted price that I end up needing to pay. Moreover, I am interested in the "right hand side" of this relationship since tomorrow, being Valentine's Day, I am contemplating purchasing a very large number of flowers. So, if  

amt = a vector of quantities of flowers bought on various days

deltaP = a vector of the differences between the purchase price and the posted price on those days  

Two simple models might be:  

mottle1 = lm( deltaP ~ amt )

or

mottle2 = lm( deltaP ~ amt - 1 )  

But, I have the urge to set the model up as follows  

mottle3 = lm( deltaP ~ amt - 1, weights = amt )  

because I want the big purchases to weigh much more in the calculation of the slope than the small purchases, but I have an uneasy feeling that this amounts to double-dipping/counting. Can anyone explain to me if/why this is a bad idea?  

Thanks,  

Dan

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 13 Feb 2008 - 17:24:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 13 Feb 2008 - 19:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive