简体   繁体   English

从glmer(family = inverse.gaussian(link =“ log”))进行反向转换

[英]back transform from glmer(family=inverse.gaussian(link=“log”))

I am currently running a glmer with family=inverse.gaussian(link="log"). 我目前与family = inverse.gaussian(link =“ log”)一起使用。 The "top model" I have is as follows: 我拥有的“顶级模特”如下:

 full_mod2=glmer(cpueplus1 ~ assnage * logcobb + (1|fyear) + (1|flocation),
 data=yc,family=inverse.gaussian(link = "log"))

with the output for the coefficients being: 系数的输出为:

  Fixed effects:
                   Estimate Std. Error t value Pr(>|z|)    
  (Intercept)      1.53670    0.16126   9.529  < 2e-16 ***
  assnage         -0.30168    0.04909  -6.146 7.96e-10 ***
  logcobb          0.42032    0.06155   6.829 8.54e-12 ***
  assnage:logcobb -0.10132    0.02395  -4.231 2.33e-05 ***

I am hoping to have an equation which I will be able to hold one of the variables constant (for example assnage) and determine the effect of the other variable across the observed values (for example logcobb). 我希望有一个方程,可以使其中一个变量保持恒定(例如assnage),并确定另一个变量在观察值上的影响(例如logcobb)。 With gmler, you are able to use "invlogit()" easily for binomial dristributions, is there something similar to inverse.gaussian? 使用gmler,您可以轻松地将“ invlogit()”用于二项式分布,是否有与inverse.gaussian类似的东西? For example, when assnage equals the mean (2), max(4), or min(1): 例如,当asnnage等于平均值​​(2),max(4)或min(1)时:

 mean_age=FUNCTION(1.53670 + -0.30168*(mean(assnage)) +
 0.42032*observedvalues(logcobb) + -0.10132*(mean(assnage)*observedvalues(logcobb))

You can get the inverse function from the inverse.gaussian object. 您可以从inverse.gaussian对象获得逆函数。

inv.gaus <- inverse.gaussian(link = "log")

inv.gaus$linkfun(10)
inv.gaus$linkinv(inv.gaus$linkfun(10))

You can also look at the definition of these functions directly. 您也可以直接查看这些函数的定义。

inv.gaus$linkfun
 function (mu) log(mu) <environment: namespace:stats> 
inv.gaus$linkinv
 function (eta) pmax(exp(eta), .Machine$double.eps) <environment: namespace:stats> 

you can see more of the attributes in the link object by looking at attributes(inv.gaus) 您可以通过查看attributes(inv.gaus)来查看链接对象中的更多属性

to complete your back transformation, you may use 要完成向后转换,您可以使用

inv.gaus$linkinv(1.53670 + -0.30168*(mean(assnage)) +
 0.42032*observedvalues(logcobb) + -0.10132*(mean(assnage)*observedvalues(logcobb))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM