R-package for partially linear mediation
To install:
devtools::install_github("ohines/plmed")
library(plmed)
To see documentation
?plmed
?G_estimation
?TTS
To uninstall:
remove.packages(plmed)
R-package for partially linear mediation
IF.glm <- function(object,x=object$x){
NROW(object$y)*(x*object$prior.weights*(object$y-object$fitted.values))%*%chol2inv(object$qr$qr)
}
The chol2inv(object$qr$qr) seems magic, can you elaborate, please? Thank you!
Under the canonical link, the estimating equation is x{y-mu(x^t b)}, hence the influence function (by the argument of Z-estimation) is [E{mu'(x^t b) x x^t}]^-1 {y-mu(x^t b)}x. My naive implementation is this:
glm_IF <- function(glm_obj) {
# assume glm_obj fitted with x = True
(glm_obj$x * glm_obj$prior.weights * (glm_obj$y - glm_obj$fitted.values)) %*%
solve(crossprod(glm_obj$family$mu.eta(glm_obj$linear.predictors) * glm_obj$x, glm_obj$x) / NROW(glm_obj$y))
}
By the way, I just happened to google with "glm influence function" and your repo pops up. I'm also dealing with some two-step estimation which requires the first-step influence function. I thought it would be convenient to use the glm object.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.