预测R中的GLM功能

时间:2016-10-31 12:07:44

标签: r predict

我正在使用以下数据:

Dose    Cells   Dicentrics  
0.1     328     2   
0.2     723     1   
0.5     513     4   
1.0     369     4   
1.5     280     7   
2.0     361     19  
3.0     238     26

我正在使用read.tableattach来加载表格。我被建议使用模型Dicentrics = Cells(b1 + b2剂量+ b3剂量^ 2)。因此我适合一个glm

fit1 <- glm(Dicentrics ~ Cells+Cells*Dose+Cells*(Dose^2)-1, family=poisson(link="identity"))

现在我想将其可视化并将其绘制在Dicentric / Cells~Dose Plot之上。 enter image description here

我想在这个情节上绘制我的预测线。

当我使用predict(fit1)时,我得到了

 predict(fit1, type="response") # predicted values

        1         2         3         4         5 
 1.124833  2.521284  2.677220  4.906738  7.802772 
        6         7 
17.662902 26.304251 

0 个答案:

没有答案