Skip to main content
deleted 10 characters in body
Source Link
kjetil b halvorsen
  • 82.8k
  • 32
  • 201
  • 663
reg1a <- plm(log_meanweeklyhoursworked ~ flood_occurrence + drought_occurrence +labourforceparti 
               +log_gdp_percapita + nationalpopulation + log_education + urbanization + log_householdsize,
                data = labournationalall,
                index = c("reference_area", "start_year"),
                model = "within", #fixed effects model within entities
                effect = "twoway") #with both entity and time fixed effects included

# Compute cluster-robust standard errors at the entity (reference area) level
vcov_entity <- vcovHC(reg1a, type = "HC1", cluster = "group")

# Compute cluster-robust standard errors at the year level
vcov_year <- vcovHC(reg1a, type = "HC1", cluster = "time")

# Combine the results
summary_combined <- list(
  entity_level = summary(reg1a, vcov = vcov_entity),
  year_level = coeftest(reg1a, vcov. = vcov_year)
)
reg1a <- plm(log_meanweeklyhoursworked ~ flood_occurrence + 
             drought_occurrence + labourforceparti + 
             log_gdp_percapita + nationalpopulation + log_education +
             urbanization + log_householdsize,
              data = labournationalall,
              index = c("reference_area", "start_year"),
              model = "within", # fixed effects model within entities
              effect = "twoway") # with both entity and time fixed 
                 # effects included

# Compute cluster-robust standard errors at the entity 
# (reference area) level
vcov_entity <- vcovHC(reg1a, type = "HC1", cluster = "group")

# Compute cluster-robust standard errors at the year level
vcov_year <- vcovHC(reg1a, type = "HC1", cluster = "time")

# Combine the results
summary_combined <- list(
  entity_level = summary(reg1a, vcov = vcov_entity),
  year_level = coeftest(reg1a, vcov. = vcov_year)
)
reg1a <- plm(log_meanweeklyhoursworked ~ flood_occurrence + drought_occurrence +labourforceparti 
               +log_gdp_percapita + nationalpopulation + log_education + urbanization + log_householdsize,
                data = labournationalall,
                index = c("reference_area", "start_year"),
                model = "within", #fixed effects model within entities
                effect = "twoway") #with both entity and time fixed effects included

# Compute cluster-robust standard errors at the entity (reference area) level
vcov_entity <- vcovHC(reg1a, type = "HC1", cluster = "group")

# Compute cluster-robust standard errors at the year level
vcov_year <- vcovHC(reg1a, type = "HC1", cluster = "time")

# Combine the results
summary_combined <- list(
  entity_level = summary(reg1a, vcov = vcov_entity),
  year_level = coeftest(reg1a, vcov. = vcov_year)
)
reg1a <- plm(log_meanweeklyhoursworked ~ flood_occurrence + 
             drought_occurrence + labourforceparti + 
             log_gdp_percapita + nationalpopulation + log_education +
             urbanization + log_householdsize,
              data = labournationalall,
              index = c("reference_area", "start_year"),
              model = "within", # fixed effects model within entities
              effect = "twoway") # with both entity and time fixed 
                 # effects included

# Compute cluster-robust standard errors at the entity 
# (reference area) level
vcov_entity <- vcovHC(reg1a, type = "HC1", cluster = "group")

# Compute cluster-robust standard errors at the year level
vcov_year <- vcovHC(reg1a, type = "HC1", cluster = "time")

# Combine the results
summary_combined <- list(
  entity_level = summary(reg1a, vcov = vcov_entity),
  year_level = coeftest(reg1a, vcov. = vcov_year)
)
formatting and tags
Source Link
Shawn Hemelstrand
  • 18.5k
  • 6
  • 35
  • 92

Can a dummy variable or treatment variable be an independent variable? My independent variable take the value 1 if a flood occurs in a specific country in a specific year and 0 if no flood happens. And same thing for my other independent variable. I'm using two-way fixed effects model to estimate the causal effect of droughts and floods on log_meanweeklyhoursworkedlog_meanweeklyhoursworked. The problem here is that I'm getting statistically insignificant results on the flood occurrence and drought occurrence dependent variables. Why is that? And how can I solve this problem? Please provide a corrected version of my coding: `reg1a <- plm(log_meanweeklyhoursworked ~ flood_occurrence + drought_occurrence +labourforceparti +log_gdp_percapita + nationalpopulation + log_education + urbanization + log_householdsize, data = labournationalall, index = c("reference_area", "start_year"), model = "within", #fixed effects model within entities effect = "twoway") #with both entity and time fixed effects included

Compute cluster-robust standard errors at the entity (reference area) level

vcov_entity <- vcovHC(reg1a, type = "HC1", cluster = "group")

Compute cluster-robust standard errors at the year level

vcov_year <- vcovHC(reg1a, type = "HC1", cluster = "time")

Combine the results

summary_combined <- list( entity_level = summary(reg1a, vcov = vcov_entity), year_level = coeftest(reg1a, vcov. = vcov_year) )`

reg1a <- plm(log_meanweeklyhoursworked ~ flood_occurrence + drought_occurrence +labourforceparti 
               +log_gdp_percapita + nationalpopulation + log_education + urbanization + log_householdsize,
                data = labournationalall,
                index = c("reference_area", "start_year"),
                model = "within", #fixed effects model within entities
                effect = "twoway") #with both entity and time fixed effects included

# Compute cluster-robust standard errors at the entity (reference area) level
vcov_entity <- vcovHC(reg1a, type = "HC1", cluster = "group")

# Compute cluster-robust standard errors at the year level
vcov_year <- vcovHC(reg1a, type = "HC1", cluster = "time")

# Combine the results
summary_combined <- list(
  entity_level = summary(reg1a, vcov = vcov_entity),
  year_level = coeftest(reg1a, vcov. = vcov_year)
)

Can a dummy variable or treatment variable be an independent variable? My independent variable take the value 1 if a flood occurs in a specific country in a specific year and 0 if no flood happens. And same thing for my other independent variable. I'm using two-way fixed effects model to estimate the causal effect of droughts and floods on log_meanweeklyhoursworked. The problem here is that I'm getting statistically insignificant results on the flood occurrence and drought occurrence dependent variables. Why is that? And how can I solve this problem? Please provide a corrected version of my coding: `reg1a <- plm(log_meanweeklyhoursworked ~ flood_occurrence + drought_occurrence +labourforceparti +log_gdp_percapita + nationalpopulation + log_education + urbanization + log_householdsize, data = labournationalall, index = c("reference_area", "start_year"), model = "within", #fixed effects model within entities effect = "twoway") #with both entity and time fixed effects included

Compute cluster-robust standard errors at the entity (reference area) level

vcov_entity <- vcovHC(reg1a, type = "HC1", cluster = "group")

Compute cluster-robust standard errors at the year level

vcov_year <- vcovHC(reg1a, type = "HC1", cluster = "time")

Combine the results

summary_combined <- list( entity_level = summary(reg1a, vcov = vcov_entity), year_level = coeftest(reg1a, vcov. = vcov_year) )`

Can a dummy variable or treatment variable be an independent variable? My independent variable take the value 1 if a flood occurs in a specific country in a specific year and 0 if no flood happens. And same thing for my other independent variable. I'm using two-way fixed effects model to estimate the causal effect of droughts and floods on log_meanweeklyhoursworked. The problem here is that I'm getting statistically insignificant results on the flood occurrence and drought occurrence dependent variables. Why is that? And how can I solve this problem? Please provide a corrected version of my coding:

reg1a <- plm(log_meanweeklyhoursworked ~ flood_occurrence + drought_occurrence +labourforceparti 
               +log_gdp_percapita + nationalpopulation + log_education + urbanization + log_householdsize,
                data = labournationalall,
                index = c("reference_area", "start_year"),
                model = "within", #fixed effects model within entities
                effect = "twoway") #with both entity and time fixed effects included

# Compute cluster-robust standard errors at the entity (reference area) level
vcov_entity <- vcovHC(reg1a, type = "HC1", cluster = "group")

# Compute cluster-robust standard errors at the year level
vcov_year <- vcovHC(reg1a, type = "HC1", cluster = "time")

# Combine the results
summary_combined <- list(
  entity_level = summary(reg1a, vcov = vcov_entity),
  year_level = coeftest(reg1a, vcov. = vcov_year)
)
Source Link

Indicator variables/treatment variables as an independent variable?

Can a dummy variable or treatment variable be an independent variable? My independent variable take the value 1 if a flood occurs in a specific country in a specific year and 0 if no flood happens. And same thing for my other independent variable. I'm using two-way fixed effects model to estimate the causal effect of droughts and floods on log_meanweeklyhoursworked. The problem here is that I'm getting statistically insignificant results on the flood occurrence and drought occurrence dependent variables. Why is that? And how can I solve this problem? Please provide a corrected version of my coding: `reg1a <- plm(log_meanweeklyhoursworked ~ flood_occurrence + drought_occurrence +labourforceparti +log_gdp_percapita + nationalpopulation + log_education + urbanization + log_householdsize, data = labournationalall, index = c("reference_area", "start_year"), model = "within", #fixed effects model within entities effect = "twoway") #with both entity and time fixed effects included

Compute cluster-robust standard errors at the entity (reference area) level

vcov_entity <- vcovHC(reg1a, type = "HC1", cluster = "group")

Compute cluster-robust standard errors at the year level

vcov_year <- vcovHC(reg1a, type = "HC1", cluster = "time")

Combine the results

summary_combined <- list( entity_level = summary(reg1a, vcov = vcov_entity), year_level = coeftest(reg1a, vcov. = vcov_year) )`