Skip to content

Commit

Permalink
whitespace and one typo
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesonnet committed May 31, 2018
1 parent 6e01b2c commit 96d386a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/helper_lm_robust_fit.R
Expand Up @@ -178,10 +178,10 @@ lm_robust_fit <- function(y,
data[["femat"]] <- data[["weights"]] * data[["femat"]]
}
}

}



# Also need second stage residuals for fstat
if (iv_second_stage) {
Expand All @@ -193,6 +193,7 @@ lm_robust_fit <- function(y,
}

if (se_type != "none") {

vcov_fit <- lm_variance(
X = if (se_type %in% c("HC2", "HC3", "CR2") && fes) cbind(data[["X"]], data[["femat"]]) else data[["X"]],
Xunweighted = if (se_type %in% c("HC2", "HC3", "CR2") && fes && weighted) cbind(data[["Xunweighted"]], data[["fematunweighted"]]) else data[["Xunweighted"]],
Expand Down Expand Up @@ -231,8 +232,8 @@ lm_robust_fit <- function(y,
return_list[["fitted.values"]] <- as.matrix(data[["yoriginal"]] - fit_vals[["ei"]])

if (weighted) {
return_list[["fitted.values"]] <- return_list[["fitted.values"]] / data[["weights"]])
}
return_list[["fitted.values"]] <- return_list[["fitted.values"]] / data[["weights"]]
}
} else {
fitted.vals_name <- if (weighted) "fitted.values.unweighted" else "fitted.values"
return_list[["fitted.values"]] <- as.matrix(fit_vals[[fitted.vals_name]])
Expand Down

0 comments on commit 96d386a

Please sign in to comment.