Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. (30pts) The following code was used to perform the permutation test for Chargaff's table. To run the code, you need to put the file
2. (30pts) The following code was used to perform the permutation test for Chargaff's table. To run the code, you need to put the file ChargaffTable RData in the same folder as your R script file. If you still get an error message "No such file or directory" when you load ChargaffTable.RData, then in the RStudio menu bar click Session -> Set Working Directory -> To Source File Location. load("ChargaffTable.RData") statChf = function(x){ sum((x[, 1] - x[. 2])^2 + (x[. 3] - x[. 4])^2) } chistat = statChf(ChargaffTable) n.rep = 10000 permstat = numeric(n.rep) for (i in 1:n.rep)( permuted = tapply(ChargaffTable, 1, sample)) permstat[i] = statChf(permuted) pChf = sum(permstat
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started