The situation: I'm struggling with a predictive analysis of food sales prices using a generalized linear model. My dataset contains different kinds of food (cheeses, vegetables, meats, spices etc.) and hence I am splitting the dataset completely by these kinds when doing the analysis, because they are very different by nature.
The current model: The dataset/model contains both factors such as "country of production" and numeric variables such as "transport distance" which is all used in the gamma based GLM i R.
The problem: Now in general my model fits pretty well, however sometimes in rare cases some of the metric variables gets the opposite sign (+/-) than you would expect it to have, because the model somehow catches other influences.
An example: An example would be spices. All spices have a relative long "transport distance" and a relative long shelf life and hence a pretty small impact on the sales price compared to e.g. meat. So in this case the model might by accident end up giving the "transport distance" variable a small but negative value - which is of cause wrong because it would mean that the longer the distance the food was transported the lower the price would be.
My question: What kind of model should I use in R if I wan't something similar to a GLM model but I want to be able to specify restrictions on some of the variables/coefficients? E.g. if I want to say that an increased "transport distance" should ALWAYS have a positive impact on the sales price?
Ideas: I have heard something about both "Bayesian GLM" models or using a so called "prior distribution" but I have no idea which one, if any, would be the best to use..?
UPDATE The answer below by @ACD is not, exactly what I'm looking for. I don't need an explanation of WHY this occurs, I need a solution to restricting the coefficient signs :-)