楼主: llkknnllyytt
1642 6

[问答] 大家能帮我把R这个程序语句解读一下吗?谢谢 [推广有奖]

  • 2关注
  • 4粉丝

讲师

25%

还不是VIP/贵宾

-

威望
0
论坛币
142 个
通用积分
1.9605
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
5071 点
帖子
324
精华
0
在线时间
229 小时
注册时间
2015-1-12
最后登录
2023-7-3

楼主
llkknnllyytt 发表于 2015-10-25 19:37:52 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

Age-period-cohort analysis can alternatively be done by the package Epi.

Examples#########################        Belgian lung cancer########        1. Get apc.data.list#        This is ready made.  For other data construct list using apc.data.listdata.list        <- data.Belgian.lung.cancer()objects(data.list)data.list########        2. Plot data#        Plot all data.#        Note a warning is produced because the defaults settings#        lead to an unbalanced grouping of data.apc.plot.data.all(data.list)#        Or make individual plots.#        Plot data sums.apc.plot.data.sums(data.list)#        Plot sparsity to see where data are thin.#        Plots are blank with default settings#        ... therefore change sparsity.limits.apc.plot.data.sparsity(data.list)dev.new()apc.plot.data.sparsity(data.list,sparsity.limits=c(5,10))#        Plot data using different pairs of the three time scales.#        This plot is done for mortality ratios.#        All plots appear to have approximately parallel lines.#        This indicates that interpretation should be done carefully.apc.plot.data.within(data.list,"m",1)########        3. Get a deviance table#        Need to input distribution.#   The table show that the sub-models "AC" and "Ad"#        cannot be rejected relative to the unrestricted "APC" modelapc.fit.table(data.list,"poisson.dose.response")########        4. Estimate selected models#        Consider "APC" and "Ad"#        Consider also the sub-model "A", which is not supported by#        the tests in the deviance tablefit.apc        <- apc.fit.model(data.list,"poisson.dose.response","APC")fit.at        <- apc.fit.model(data.list,"poisson.dose.response","Ad")fit.a        <- apc.fit.model(data.list,"poisson.dose.response","A")#        Get coefficients for canonical parameters throughfit.apc$coefficients.canonicalfit.at$coefficients.canonical########        5. Plot probability transforms of responses given fit#        Black circle are used for central part of distribution.#        Triangles are used in tails, green/blue/red as responses are further in tail#        No sign of mis-specification for "APC" and "Ad": there are many#        black circles and only few coloured triangles.#        In comparison the model "A" yields more extreme observations.#        That model is not supported by the data.  #        To get numerical values see apc.plot.fit.ptapc.plot.fit.pt(fit.apc)apc.plot.fit.pt(fit.at)apc.plot.fit.pt(fit.a)########        6. Plot estimated coefficients #        Consider "APC" and "Ad"#        The first row of plots show double differences of paramters#        The second row of plots shows level and slope determining a linear plane#        The third row shows double sums of double differences,#        all identified to be zero at the begining and at the end.#        Thus the plots in third row must be interpreted jointly with those in the#        second row.  The interpretation of the third row plots#        is that they show deviations from linear trends.  The third row plots are#        not invariant to changes to data arrayapc.plot.fit(fit.apc)dev.new()apc.plot.fit(fit.at)########        7. Recursive analysis#        Cut the first period group and redo analysisdata.list.subset.1 <- apc.data.list.subset(data.list,0,0,1,0,0,0)apc.fit.table(data.list.subset.1,"poisson.dose.response")########        8. Effect of ad hoc identification#        At first a subset is chosen where youngest age and cohort groups#        are truncated.  This way sparsity is eliminated#        and ad hoc identification effects are dominated by estimation#        uncertainty. Then consider#        Plot 1: parameters estimated from data without first age groups#        Plot 2: parameters estimated from all data#        Note that estimates for double difference very similar.#        Estimates for linear slopes are changed because the indices used#        for parametrising these are changed#        Estimates for detrended double sums of age and cohort double differences#        are changed, because they rely on a particular ad hoc identifications#        that have changed.  Nonetheless these plots are useful to evaulate#        variation in time trends over and above linear trends.data.list        <- data.Belgian.lung.cancer()data.list.subset <- apc.data.list.subset(data.list,2,0,0,0,0,0)fit.apc                <- apc.fit.model(data.list,"poisson.dose.response","APC")fit.apc.subset        <- apc.fit.model(data.list.subset,"poisson.dose.response","APC")apc.plot.fit(fit.apc.subset,main.outer="1. Belgian lung cancer: cut first two age groups")dev.new()apc.plot.fit(fit.apc,main.outer="2. Belgian lung cancer data: all data")
二维码

扫码加我 拉你入群

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

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

关键词:Alternative Analysis Examples example alterna package cancer 程序

沙发
刺客王朝 学生认证  发表于 2015-10-25 19:52:30
好乱啊

藤椅
richardgu26 发表于 2015-10-25 19:53:45
你直接弄个附件上来吧,这怎么读啊

板凳
llkknnllyytt 发表于 2015-10-25 20:55:17
刺客王朝 发表于 2015-10-25 19:52
好乱啊
不好意思,在R界面 打  ?apc  就出来了

报纸
llkknnllyytt 发表于 2015-10-25 20:55:55
richardgu26 发表于 2015-10-25 19:53
你直接弄个附件上来吧,这怎么读啊
不好意思,在R 的界面 打 ?apc  出来的  因为我想用apc这个包

地板
llkknnllyytt 发表于 2015-10-25 20:57:03
Identification.pdf (189.19 KB)

7
llkknnllyytt 发表于 2015-10-25 20:58:30
richardgu26 发表于 2015-10-25 19:53
你直接弄个附件上来吧,这怎么读啊
回复了,麻烦给帮帮忙

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-2 10:44