0

I want to run a fixed effect regression with net migration being the response and gini index a predictor. I add some control variables. The data is from WDI.

Because the response in the data set has negative values, I added the minimum value + 1 to make it positive in order for the poisson regression to work.

library(WDI)
data <- WDI(
  country = c("AL", "AD", "AT", "BE", "BA", "HR", "EE", "FR", "GR", "IS",
              "IT", "LI", "MC", "ME", "PT", "SK", "ES", "SE", "GB", "UA",
              "BG", "CY", "DK", "FO", "FI", "DE", "IE", "XK", "LT", "LV",
              "MT", "MD", "NL", "MK", "NO", "PL", "RO", "SM", "SI", "CH",
              "TR", "RU", "BY"),
  indicator = c(
    "SI.POV.GINI", "SE.COM.DURS", "NY.GDP.PCAP.PP.KD","SL.UEM.TOTL.ZS","SP.POP.TOTL", "SM.POP.NETM"),
  start = 2004, 
  end = 2024    
)

write.csv2(data, "data.csv", row.names = FALSE) 
data <- read.csv("data.csv", header = TRUE, sep = ";", dec = ",")
attach(data)
View(data)
dim(data)
names(data)

#clean data
data <- data[3:10]
dim(data)
data <- na.omit(data)
dim(data)
summary(data)
View(data)

data$SM.POP.NETM <- data$SM.POP.NETM + 261814
summary(data)


#FE, Poisson
library(pglm) 
model1.FE = pglm(
  SM.POP.NETM ~ SI.POV.GINI + SE.COM.DURS + NY.GDP.PCAP.PP.KD + SL.UEM.TOTL.ZS + SP.POP.TOTL,
  data = data, family = poisson, model = "within"
)

summary(model1.FE)

The output seems wrong. If I specify a pglm random effect model I get some warnings.

enter image description here

2
  • Why do you have data$SM.POP.NETM + 261814 when in 2006 DEU (Germany) has -489056? Commented Dec 23, 2024 at 14:41
  • This approach of adding an arbitrary amount to make net migration positive and then trying to use Poisson regression to predict net migration is not going to make sense: in Poisson regression, $0$ is an important number, so shifting it will weaken the model. In addition migration is at least indirectly related to the size of a country so having many countries having close to an arbitrary large number out of scale to the size of the country is going to destroy the model. Commented Dec 23, 2024 at 14:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.