简体   繁体   English

在 R 中的预测 glm model 中使用指数分布

[英]Using an exponential distribution in a predictive glm model in R

I am using a glm model to predict my depending variable.我正在使用 glm model 来预测我的因变量。 For that I need to choose a family of the distribution of my variable.为此,我需要选择一个变量分布族。 unfortunately the exponential distribution is not part of the available objects of the argument "family".不幸的是,指数分布不是参数“家族”的可用对象的一部分。 Now I don't know on how I can proceed with my research.现在我不知道如何继续我的研究。 This is my model. Does anyone have an idea, what I can do?这是我的 model。有人知道我能做什么吗?

model<-train(duration~., data = data, method='glm', family= ???, trControl =trainControl(method = "repeatedcv", repeats = 10)

The exponential distribution is in the gamma family with dispersion parameter fixed at 1, so family = Gamma(link="log") should provide you with what you need.指数分布属于 gamma 族,色散参数固定为 1,因此family = Gamma(link="log")应该可以满足您的需求。 When interpreting significance or standard error of the fitted coefficients assuming exponential, you specify the dispersion.在假设指数假设解释拟合系数的显着性或标准误差时,您指定分散。

Since your example wasn't reproducible, an example using glm and summary is:由于您的示例不可重现,因此使用glmsummary的示例是:

mdl <- glm(formula = duration ~.,  family = Gamma(link="log"), data = your_data)

summary(mdl, dispersion = 1) 

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

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