{"id":1092,"date":"2017-12-28T21:23:14","date_gmt":"2017-12-28T12:23:14","guid":{"rendered":"https:\/\/plaza.umin.ac.jp\/~OIO\/?p=1092"},"modified":"2018-07-28T08:49:44","modified_gmt":"2018-07-27T23:49:44","slug":"case-crossover-design-3","status":"publish","type":"post","link":"https:\/\/plaza.umin.ac.jp\/~OIO\/?p=1092","title":{"rendered":"Case Crossover Design \u2013 (3)"},"content":{"rendered":"<h1>Case Crossover Design \u2013 (3)<\/h1>\n<p><a href=\"https:\/\/wp.me\/p9b6zl-ff\">\u524d\u56de\u306e\u8a18\u4e8b<\/a>\u306e\u3064\u3065\u304d\u3067\u3059<\/p>\n<h4><strong>Logistic regression model<\/strong><\/h4>\n<p>\u3053\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u306f\u3001\u89b3\u5bdf\u671f\u9593\u3092\u5358\u4f4d\u671f\u9593\u3054\u3068\uff08\u3053\u306e\u5834\u5408\u306f1hr\uff09\u306b\u5206\u5272\u3057\u3066\u3001\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f\u3057\u305f\u6642\u4ee5\u5916\u306f\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3068\u3057\u3066\u3001\u591a\u304f\u306econtrol\u3068\u5c11\u6570\u56de\u306ecase\u3092\u89b3\u5bdf\u3057\u305fcase-control study\u306e\u3088\u3046\u306b\u307f\u306a\u3057\u307e\u3059\u3002\u539f\u6587\u3067\u306f[the case-crossover design can be viewed as matched case-control design with 1:M matched pairs]\u3068\u306a\u3063\u3066\u3044\u307e\u3057\u3066\u3001\u3053\u306e\u3001\u300c\u307f\u306a\u3059\u300d\u3068\u3044\u3046\u306e\u304c\u611f\u899a\u7684\u306b\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u306e\u3067\u3059\u304c\u305d\u3046\u3044\u3046\u3053\u3068\u3089\u3057\u3044\u3067\u3059\u3002\u4f8b\u984c\u3067\u306f\u4e00\u4eba\u306b\u3064\u304d1\u5e74\u9593\u89b3\u5bdf\u3057\u3066\u30011\u56deAMI\u304c\u767a\u75c7\u305f\u3053\u3068\u306b\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u30011\u4f8b\u306e\u75c7\u4f8b\u304c\u3001\u96c6\u8a08\u4e0a8759\u4f8b\u306econtrol\u30681\u4f8b\u306ecase\u306e\u3088\u3046\u306b\u6271\u308f\u308c\u307e\u3059\u3002\u4f8b\u984c\u3067\u306f10\u4f8b\u3044\u307e\u3059\u306e\u3067\u30c8\u30fc\u30bf\u30eb\u306e\u96c6\u8a08\u4e0a\u306e\u89b3\u5bdf\u75c7\u4f8b\u6570\u306f87600\u4f8b\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002matched pair\u3092\u793a\u3059\u6307\u6a19\u3068\u3057\u3066case id\u3092\u4f7f\u7528\u3057\u305f\u3001conditional logistic regression model\u3092\u7528\u3044\u307e\u3059\u3002Formula\u306b\u306f[case~exposure+strata(id)]\u3092\u5165\u308c\u307e\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059reshape2\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u306emelt\u306f\u3001\u3053\u3093\u306a\u30c7\u30fc\u30bf\u306e\u5909\u5f62\u3092\u3057\u305f\u3044\u3068\u601d\u3046\u3068\u304d\u306b\u624b\u4f5c\u696d\u3067\u3084\u3063\u3066\u308b\u3088\u3046\u306a\u30c7\u30fc\u30bf\u306e\u5909\u5f62\u3092\u3084\u3063\u3066\u304f\u308c\u308b\u8208\u5473\u6df1\u3044\u95a2\u6570\u3067\u3059\u3002<\/p>\n<p>matrix&lt;-matrix(round(c(rr,lo,hi,or,lo.or,hi.or),2),nrow=2,byrow=TRUE)<\/p>\n<p>rownames(matrix)&lt;-c(&#8220;RR&#8221;,&#8221;OR&#8221;)<\/p>\n<p>colnames(matrix)&lt;-c(&#8220;Value&#8221;,&#8221;low 95% CI&#8221;,&#8221;high 95% CI&#8221;)<\/p>\n<p>matrix<\/p>\n<p>&nbsp;<\/p>\n<p>mat&lt;-matrix(, nrow = T-1, ncol = 0)<\/p>\n<p>for (i in 1:10) {<\/p>\n<p>if (T%%frq[i]==0) {<\/p>\n<p>exposure&lt;-c(rep(c(1,rep(0,T\/frq[i]-1)),frq[i]))[-T]<\/p>\n<p>}\u00a0\u00a0 else {<\/p>\n<p>exposure&lt;-c(rep(c(1,rep(0,trunc(T\/frq[i])-<\/p>\n<p>1)),frq[i]),rep(0,T-frq[i]*trunc(T\/frq[i])))[-T]<\/p>\n<p>}<\/p>\n<p>mat&lt;-cbind(mat,exposure)<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>commat&lt;-rbind(efftime,mat)<\/p>\n<p>library(reshape2)<\/p>\n<p>data.wide&lt;-as.data.frame(commat)<\/p>\n<p>colnames(data.wide)&lt;-c(1:10)<\/p>\n<p>data&lt;-melt(data.wide,measure=c(1:10))<\/p>\n<p>colnames(data)&lt;-c(&#8220;id&#8221;,&#8221;exposure&#8221;)<\/p>\n<p>data$case&lt;-rep(c(1,rep(0,T-1)),5)<\/p>\n<p>head(data)<\/p>\n<p>&nbsp;<\/p>\n<p>library(survival)<\/p>\n<p>mod&lt;- clogit(case~exposure+strata(id),data)<\/p>\n<p>summary(mod)<\/p>\n<p>\u7d50\u679c\u3068\u3057\u3066\u5f97\u3089\u308c\u305fodds ratio\u306f\u3001\u524d\u8a18\u4e8b\u306e\u672a\u8abf\u6574\u306eOR\u3068\u5927\u4f53\u540c\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4><strong>Time trend adjustment with conditional logistic regression model<\/strong><\/h4>\n<p>Case crossover design\u3067\u306fcase\u81ea\u8eab\u3092control\u3068\u3057\u3066\u7528\u3044\u308b\u305f\u3081\u3001\u5e74\u9f62\u30fb\u6027\u5225\u30fb\u65e2\u5f80\u6b74\u3084\u57fa\u790e\u75be\u60a3\u3068\u3044\u3063\u305f\u75c7\u4f8b\u306e\u80cc\u666f\u56e0\u5b50\u306e\u3088\u3046\u306a\u4ea4\u7d61\u56e0\u5b50\u306f\u8abf\u6574\u3055\u308c\u3066\u3044\u308b\u3068\u3057\u3066\u6271\u308f\u308c\u3066\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u306a\u304c\u3089\u3001\u30c8\u30ec\u30f3\u30c9\u306e\u4ea4\u7d61\u3092\u907f\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u30c8\u30ec\u30f3\u30c9\u306e\u4ea4\u7d61\u3068\u306f\uff1f\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u304c\u3001\u53c2\u8003\u306b\u3057\u3066\u3044\u308b\u6587\u732e\uff08\u4e2d\u56fd\u8ad6\u6587<span id=\"~QKLIP61SJ2G56CGaIqqn\" class=\"abt-citation noselect mceNonEditable\" data-reflist=\"[&quot;3693209827&quot;]\"><sup>1<\/sup><\/span>\u3068Maclure\u6587\u732e <span id=\"Lk~f_JjJeJ379M3LuZ4Xj\" class=\"abt-citation noselect mceNonEditable\" data-reflist=\"[&quot;3497300075&quot;]\" data-footnote=\"undefined\"><sup>2<\/sup><\/span>\uff09\u3067\u306f\u3001MI\u306e\u767a\u73fe\u306f\u65e5\u5185\u5909\u52d5\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u53d6\u308b\u3053\u3068\u304c\u77e5\u3089\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u4f8b\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u3057\u3066\u30b3\u30fc\u30d2\u30fc\u3092\u98f2\u3080\u306e\u3082\u304a\u305d\u3089\u304f\u65e5\u5185\u5909\u52d5\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u53d6\u308a\u305d\u3046\u3067\u3059\u3002\u305d\u3053\u3067\u3001\u671d\u3001\u663c\u3001\u5348\u5f8c\u3001\u591c\u306b\u5bfe\u5fdc\u3057\u30661, 2, 3, 4\u306e\u5024\u3092\u53d6\u308b\u5909\u6570clock\u3092\u5c0e\u5165\u3057\u3066\u8abf\u6574\u3057\u307e\u3059\u3002(\u305f\u3060\u3057\u3001\u4f8b\u984c\u3067\u306fAMI\u306e\u767a\u75c7\u6642\u523b\u304c\u4e0d\u660e\u3067\u3059\u306e\u3067\u3001\u30c7\u30fc\u30bf\u304c\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u3067warning\u304c\u51fa\u307e\u3059\u3002\u79c1\u306e\u611f\u899a\u3067\u306fvariable \u306bmissing data\u304c\u3042\u308b\u3068\u305d\u306e\u89b3\u5bdf\u306f\u8a08\u7b97\u304b\u3089\u9664\u5916\u3055\u308c\u3001\u81ea\u7531\u5ea6\u304c\u6e1b\u308b\u3068\u3044\u3046\u65b9\u304c\u3057\u3063\u304f\u308a\u304d\u307e\u3059\u3002)<\/p>\n<p>data$clock&lt;-c(rep(1,T\/(365<em>4)),rep(2,T\/(365<\/em>4)),rep(3,T\/(365<em>4)),rep(4,T\/(365<\/em>4)))<\/p>\n<p>mod.adj&lt;- clogit(case~exposure+clock+strata(id),data)<\/p>\n<p>summary(mod.adj)<\/p>\n<div id=\"abt-bibliography\" class=\"abt-bibliography noselect mceNonEditable\" data-reflist=\"[&quot;3693209827&quot;,&quot;3497300075&quot;]\">\n<div id=\"abt-bibliography__container\" class=\"abt-bibliography__container\">\n<div id=\"3693209827\">\n<div class=\"csl-entry flush\">\n<div class=\"csl-left-margin\">1.<\/div>\n<div class=\"csl-right-inline\">Zhang Z. Case-crossover design and its implementation in R. <i>Ann Transl Med<\/i>. 2016;4(18):341. <span class=\"abt-url\">[<a href=\"https:\/\/www.ncbi.nlm.nih.gov\/pubmed\/27761445\" target=\"_blank\" rel=\"noopener noreferrer\">PubMed<\/a>]<\/span><\/div>\n<\/div>\n<\/div>\n<div id=\"3497300075\">\n<div class=\"csl-entry flush\">\n<div class=\"csl-left-margin\">2.<\/div>\n<div class=\"csl-right-inline\">Maclure M. The case-crossover design: a method for studying transient effects on the risk of acute events. <i>Am J Epidemiol<\/i>. 1991;133(2):144-153. <span class=\"abt-url\">[<a href=\"https:\/\/www.ncbi.nlm.nih.gov\/pubmed\/1985444\" target=\"_blank\" rel=\"noopener noreferrer\">PubMed<\/a>]<\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Case Crossover Design \u2013 (3) \u524d\u56de\u306e\u8a18\u4e8b\u306e\u3064\u3065\u304d\u3067\u3059 Logistic regression model \u3053\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u306f\u3001\u89b3\u5bdf\u671f\u9593\u3092\u5358\u4f4d\u671f\u9593\u3054\u3068\uff08\u3053\u306e\u5834\u5408\u306f1hr\uff09\u306b\u5206\u5272\u3057\u3066\u3001\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1092","post","type-post","status-publish","format-standard","hentry","category-science"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p9b6zl-hC","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=\/wp\/v2\/posts\/1092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1092"}],"version-history":[{"count":0,"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=\/wp\/v2\/posts\/1092\/revisions"}],"wp:attachment":[{"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plaza.umin.ac.jp\/~OIO\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}