全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
6876 2
2012-07-27
代码如下
> tree<-read.table("tree.txt",head=T);tree
   biomass species soil
1       32       7    0
2       32       8    0
3       32       8    0
4       37      15    3
5       37      15    1
6       37      17    3
7       42      11    8
8       42      28   14
9       42      15   12
10      47      10   10
11      47      12   12
12      47      13   13
13      52      18   18
14      52      19   19
15      52      22   22
> tree.glm<-glm(biomass~species+soil,family="poisson",data=tree)
> summary(tree.glm)
Call:
glm(formula = biomass ~ species + soil, family = "poisson", data = tree)
Deviance Residuals:
    Min       1Q   Median       3Q      Max  
-0.4591  -0.3788   0.1119   0.2371   0.5177  
Coefficients:
             Estimate Std. Error z value Pr(>|z|)   
(Intercept)  3.586004   0.116802  30.702  < 2e-16 ***
species     -0.005741   0.009559  -0.601 0.548130   
soil         0.024686   0.007269   3.396 0.000683 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for poisson family taken to be 1)
    Null deviance: 18.0038  on 14  degrees of freedom
Residual deviance:  1.6885  on 12  degrees of freedom
AIC: 91.165
Number of Fisher Scoring iterations: 3

怎样才能做出类似下面的图,请各位不吝赐教,给出详细代码,谢谢
3333.jpg 1111.jpg 2222.jpg
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-12-16 16:25:46
opar+par加作图命令就可以了比如——

opar <- par(no.readonly = TRUE)
par(mfrow = c(1, 2))
attach(breslow.dat)
hist(sumY, breaks = 20, xlab = "Seizure Count", main = "Distribution of Seizures")
boxplot(sumY ~ Trt, xlab = "Treatment", main = "Group Comparisons")
par(opar)


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2021-2-14 16:02:44
DM小菜鸟 发表于 2014-12-16 16:25
用opar+par加作图命令就可以了比如——

opar
虽然你复制很辛苦,但是这个做出来不是拟合图
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群