jeudi 28 avril 2022

Compare 2 random effects models

I have 2 random effects models which differs from each other based on one variable.

M1= plm(formula = Productiviteit ~ Kapitaalintensiteit + Bedrijfsgrootte + 
    Percentage_Hoogopgeleid + Gem_leeftijd_TMT + Aantal_leden_TMT + 
    J_2012 + J_2013 + J_2014 + J_2015 + J_2016 + J_2017 + J_2018 + 
    A + B + C + D + E + F + G + H + I + J + K + L + N + O + P + 
    Q + R + S, data = df, model = "random", index = c("Naam", 
    "Index_jaar"))

M2= plm(formula = Productiviteit ~ Kapitaalintensiteit + Bedrijfsgrootte + 
    Percentage_Hoogopgeleid + Std_leeftijd_TMT + Gem_leeftijd_TMT + 
    Aantal_leden_TMT + J_2012 + J_2013 + J_2014 + J_2015 + J_2016 + 
    J_2017 + J_2018 + A + B + C + D + E + F + G + H + I + J + 
    K + L + N + O + P + Q + R + S, data = df, model = "random", 
    index = c("Naam", "Index_jaar"))

in Model 2 I only added Std_leeftijd_TMT.

Now I want to compare these 2 models and see if model 2 has a significant better fit. I want to test this with lrtest(test1,test2), but i get following error: Error in UseMethod("logLik") : no applicable method for 'logLik' applied to an object of class "c('plm', 'panelmodel')"

Are there any other possibilities for comparing two random effects models?




Aucun commentaire:

Enregistrer un commentaire