# Multilevel or fixed effects to estimate panel of port costs?

I have a panel dataset on seaborne shipment prices for a sample of trading routes. The data is a fixed annual price, based on a) port costs and b) fuel (a function of distance and fuel price). The major unobserved variable is port cost, which differs by port, though may be similar by area. Each observation is a port-pair such that there are two port costs included in the price.

The goal is to predict the price for a number of routes not included in the sample, most likely just at a more aggregate area-area level, since there are port-pairs where we only observe a loadarea-port pair or a loadarea-dischargearea pair for instance.

Year LoadPort LoadCountry LoadArea DischargePort DischargeCountry DischargeArea  Price
2007  ABIDJAN  IVORY COAST WAF      LOOP TERMINAL USA              USG            \$X1


The data is an unbalanced panel dataset over a 5 yr time interval. My questions are the following:

1. Does it make sense to use a fixed effects model with dummies for the LoadPort and DischargePort? I am not sure this is what I want since I need to get an estimate of area-area average and not sure averaging the port-pair constants within areas is robust. I would also like to preserve the model's capability to predict distance correlation when I need a port-port estimate.
2. If yes to 1, how do you add another type of fixed effect in R? The plm R instructions are for typical panel datasets where you have individuals or firms across time with some constant unobserved, but in this case it's two unobserved constants per observation.
3. I have not used multilevel regression before but it strikes me that this problem falls into this class, does anyone have a quick and dirty solution? It could be just a route fixed effect, but I don't know how to implement in R. I am not worried about elegance at this stage.
• Is port cost the same if the port is a loading port as if the same port is a discharge port? – jbowman Nov 30 '12 at 15:49