{"action":"opened","issue":{"url":"https://api.github.com/repos/STAT540-UBC/Discussion/issues/116","repository_url":"https://api.github.com/repos/STAT540-UBC/Discussion","labels_url":"https://api.github.com/repos/STAT540-UBC/Discussion/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/STAT540-UBC/Discussion/issues/116/comments","events_url":"https://api.github.com/repos/STAT540-UBC/Discussion/issues/116/events","html_url":"https://github.com/STAT540-UBC/Discussion/issues/116","id":140570357,"number":116,"title":"Assignment Q5.2","user":{"login":"hui-tony-zk","id":8253336,"avatar_url":"https://avatars.githubusercontent.com/u/8253336?v=3","gravatar_id":"","url":"https://api.github.com/users/hui-tony-zk","html_url":"https://github.com/hui-tony-zk","followers_url":"https://api.github.com/users/hui-tony-zk/followers","following_url":"https://api.github.com/users/hui-tony-zk/following{/other_user}","gists_url":"https://api.github.com/users/hui-tony-zk/gists{/gist_id}","starred_url":"https://api.github.com/users/hui-tony-zk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hui-tony-zk/subscriptions","organizations_url":"https://api.github.com/users/hui-tony-zk/orgs","repos_url":"https://api.github.com/users/hui-tony-zk/repos","events_url":"https://api.github.com/users/hui-tony-zk/events{/privacy}","received_events_url":"https://api.github.com/users/hui-tony-zk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-14T04:12:13Z","updated_at":"2016-03-14T04:12:13Z","closed_at":null,"body":"I'm confused about this question - what exactly is meant by \"model the interaction\"?\r\n\r\nHere's what I did, although I'm not sure that it's correct (p.s. this is reproducible code, so just copy+pasting should work if you wanted to try it)\r\n\r\n```\r\nq1_data <- read.table(\"https://github.com/hui-tony-zk/STAT540-UBC.github.io/raw/master/NHBE_transcriptome_data.txt\")\r\n\r\nq1_metadata <- read.table(\"https://stat540-ubc.github.io/homework/assignment/homework_data/NHBE_design.txt?raw=true\") %>% \r\n  mutate(hour = gsub(\"_h\", \"\", time) %>% as.numeric())\r\n\r\nq5.2_design_matrix <- model.matrix(~hour*Treatment, q1_metadata)\r\n\r\nq5.2_fit <- lmFit(q1_data, q5.2_design_matrix) %>% eBayes() \r\n\r\nq5.2_fit$coefficients %>% colnames\r\n```\r\n\r\n```\r\n## [1] \"(Intercept)\"           \"hour\"                  \"Treatmentcontrol\"     \r\n## [4] \"hour:Treatmentcontrol\"\r\n```\r\n\r\nBased on [section 9.5.4 of the `limma` user manual](https://bioconductor.org/packages/release/bioc/vignettes/limma/inst/doc/usersguide.pdf), I believe the 4th coefficient is the interaction factor, but not sure what it means to have a \"significant interaction\"\r\n\r\nPS, the design matrix looks like this for me:\r\n\r\n```\r\n##                    (Intercept) hour Treatmentcontrol hour:Treatmentcontrol\r\n## GSE10718_Biomat_1            1   24                1                    24\r\n## GSE10718_Biomat_10           1    1                1                     1\r\n## GSE10718_Biomat_11           1    1                1                     1\r\n## GSE10718_Biomat_12           1    1                1                     1\r\n## GSE10718_Biomat_13           1    4                1                     4\r\n## GSE10718_Biomat_14           1    4                1                     4\r\n## GSE10718_Biomat_15           1    4                1                     4\r\n## GSE10718_Biomat_16           1    1                0                     0\r\n## GSE10718_Biomat_17           1    1                0                     0\r\n## GSE10718_Biomat_19           1    2                0                     0\r\n## GSE10718_Biomat_2            1   24                1                    24\r\n## GSE10718_Biomat_20           1    2                0                     0\r\n## GSE10718_Biomat_21           1    2                0                     0\r\n## GSE10718_Biomat_22           1    4                0                     0\r\n## GSE10718_Biomat_23           1    4                0                     0\r\n## GSE10718_Biomat_24           1    4                0                     0\r\n## GSE10718_Biomat_3            1   24                1                    24\r\n## GSE10718_Biomat_4            1   24                0                     0\r\n## GSE10718_Biomat_5            1   24                0                     0\r\n## GSE10718_Biomat_6            1   24                0                     0\r\n## GSE10718_Biomat_7            1    2                1                     2\r\n## GSE10718_Biomat_8            1    2                1                     2\r\n## GSE10718_Biomat_9            1    2                1                     2\r\n## attr(,\"assign\")\r\n## [1] 0 1 2 3\r\n## attr(,\"contrasts\")\r\n## attr(,\"contrasts\")$Treatment\r\n## [1] \"contr.treatment\"\r\n```"}}