{"action":"closed","number":1,"pull_request":{"url":"https://api.github.com/repos/aneesrana/datasharing/pulls/1","id":84756606,"html_url":"https://github.com/aneesrana/datasharing/pull/1","diff_url":"https://github.com/aneesrana/datasharing/pull/1.diff","patch_url":"https://github.com/aneesrana/datasharing/pull/1.patch","issue_url":"https://api.github.com/repos/aneesrana/datasharing/issues/1","number":1,"state":"closed","locked":false,"title":"Test","user":{"login":"aneesrana","id":20018401,"avatar_url":"https://avatars.githubusercontent.com/u/20018401?v=3","gravatar_id":"","url":"https://api.github.com/users/aneesrana","html_url":"https://github.com/aneesrana","followers_url":"https://api.github.com/users/aneesrana/followers","following_url":"https://api.github.com/users/aneesrana/following{/other_user}","gists_url":"https://api.github.com/users/aneesrana/gists{/gist_id}","starred_url":"https://api.github.com/users/aneesrana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aneesrana/subscriptions","organizations_url":"https://api.github.com/users/aneesrana/orgs","repos_url":"https://api.github.com/users/aneesrana/repos","events_url":"https://api.github.com/users/aneesrana/events{/privacy}","received_events_url":"https://api.github.com/users/aneesrana/received_events","type":"User","site_admin":false},"body":"How to share data with a statistician\r\n\r\nThis is a guide for anyone who needs to share data with a statistician. The target audiences I have in mind are:\r\n\r\nScientific collaborators who need statisticians to analyze data for them\r\nStudents or postdocs in scientific disciplines looking for consulting advice\r\nJunior statistics students whose job it is to collate/clean data sets\r\nThe goals of this guide are to provide some instruction on the best way to share data to avoid the most common pitfalls and sources of delay in the transition from data collection to data analysis. The Leek group works with a large number of collaborators and the number one source of variation in the speed to results is the status of the data when they arrive at the Leek group. Based on my conversations with other statisticians this is true nearly universally.\r\n\r\nMy strong feeling is that statisticians should be able to handle the data in whatever state they arrive. It is important to see the raw data, understand the steps in the processing pipeline, and be able to incorporate hidden sources of variability in one's data analysis. On the other hand, for many data types, the processing steps are well documented and standardized. So the work of converting the data from raw form to directly analyzable form can be performed before calling on a statistician. This can dramatically speed the turnaround time, since the statistician doesn't have to work through all the pre-processing steps first.\r\n\r\nWhat you should deliver to the statistician\r\n\r\nFor maximum speed in the analysis this is the information you should pass to a statistician:\r\n\r\nThe raw data.\r\nA tidy data set\r\nA code book describing each variable and its values in the tidy data set.\r\nAn explicit and exact recipe you used to go from 1 -> 2,3\r\nLet's look at each part of the data package you will transfer.\r\n\r\nThe raw data\r\n\r\nIt is critical that you include the rawest form of the data that you have access to. Here are some examples of the raw form of data:\r\n\r\nThe strange binary file your measurement machine spits out\r\nThe unformatted Excel file with 10 worksheets the company you contracted with sent you\r\nThe complicated JSON data you got from scraping the Twitter API\r\nThe hand-entered numbers you collected looking through a microscope\r\nYou know the raw data is in the right format if you:\r\n\r\nRan no software on the data\r\nDid not manipulate any of the numbers in the data\r\nYou did not remove any data from the data set\r\nYou did not summarize the data in any way\r\nIf you did any manipulation of the data at all it is not the raw form of the data. Reporting manipulated data as raw data is a very common way to slow down the analysis process, since the analyst will often have to do a forensic study of your data to figure out why the raw data looks weird.\r\n\r\nThe tidy data set\r\n\r\nThe general principles of tidy data are laid out by Hadley Wickham in this paper and this video. The paper and the video are both focused on the R package, which you may or may not know how to use. Regardless the four general principles you should pay attention to are:\r\n\r\nEach variable you measure should be in one column\r\nEach different observation of that variable should be in a different row\r\nThere should be one table for each \"kind\" of variable\r\nIf you have multiple tables, they should include a column in the table that allows them to be linked\r\nWhile these are the hard and fast rules, there are a number of other things that will make your data set much easier to handle. First is to include a row at the top of each data table/spreadsheet that contains full row names. So if you measured age at diagnosis for patients, you would head that column with the name AgeAtDiagnosis instead of something like ADx or another abbreviation that may be hard for another person to understand.\r\n\r\nHere is an example of how this would work from genomics. Suppose that for 20 people you have collected gene expression measurements with RNA-sequencing. You have also collected demographic and clinical information about the patients including their age, treatment, and diagnosis. You would have one table/spreadsheet that contains the clinical/demographic information. It would have four columns (patient id, age, treatment, diagnosis) and 21 rows (a row with variable names, then one row for every patient). You would also have one spreadsheet for the summarized genomic data. Usually this type of data is summarized at the level of the number of counts per exon. Suppose you have 100,000 exons, then you would have a table/spreadsheet that had 21 rows (a row for gene names, and one row for each patient) and 100,001 columns (one row for patient ids and one row for each data type).\r\n\r\nIf you are sharing your data with the collaborator in Excel, the tidy data should be in one Excel file per table. They should not have multiple worksheets, no macros should be applied to the data, and no columns/cells should be highlighted. Alternatively share the data in a CSV or TAB-delimited text file.\r\n\r\nThe code book\r\n\r\nFor almost any data set, the measurements you calculate will need to be described in more detail than you will sneak into the spreadsheet. The code book contains this information. At minimum it should contain:\r\n\r\nInformation about the variables (including units!) in the data set not contained in the tidy data\r\nInformation about the summary choices you made\r\nInformation about the experimental study design you used\r\nIn our genomics example, the analyst would want to know what the unit of measurement for each clinical/demographic variable is (age in years, treatment by name/dose, level of diagnosis and how heterogeneous). They would also want to know how you picked the exons you used for summarizing the genomic data (UCSC/Ensembl, etc.). They would also want to know any other information about how you did the data collection/study design. For example, are these the first 20 patients that walked into the clinic? Are they 20 highly selected patients by some characteristic like age? Are they randomized to treatments?\r\n\r\nA common format for this document is a Word file. There should be a section called \"Study design\" that has a thorough description of how you collected the data. There is a section called \"Code book\" that describes each variable and its units.\r\n\r\nHow to code variables\r\n\r\nWhen you put variables into a spreadsheet there are several main categories you will run into depending on their data type:\r\n\r\nContinuous\r\nOrdinal\r\nCategorical\r\nMissing\r\nCensored\r\nContinuous variables are anything measured on a quantitative scale that could be any fractional number. An example would be something like weight measured in kg. Ordinal data are data that have a fixed, small (< 100) number of levels but are ordered. This could be for example survey responses where the choices are: poor, fair, good. Categorical data are data where there are multiple categories, but they aren't ordered. One example would be sex: male or female. Missing data are data that are missing and you don't know the mechanism. You should code missing values as NA. Censored data are data where you know the missingness mechanism on some level. Common examples are a measurement being below a detection limit or a patient being lost to follow-up. They should also be coded as NA when you don't have the data. But you should also add a new column to your tidy data called, \"VariableNameCensored\" which should have values of TRUE if censored and FALSE if not. In the code book you should explain why those values are missing. It is absolutely critical to report to the analyst if there is a reason you know about that some of the data are missing. You should also not impute/make up/ throw away missing observations.\r\n\r\nIn general, try to avoid coding categorical or ordinal variables as numbers. When you enter the value for sex in the tidy data, it should be \"male\" or \"female\". The ordinal values in the data set should be \"poor\", \"fair\", and \"good\" not 1, 2 ,3. This will avoid potential mixups about which direction effects go and will help identify coding errors.\r\n\r\nAlways encode every piece of information about your observations using text. For example, if you are storing data in Excel and use a form of colored text or cell background formatting to indicate information about an observation (\"red variable entries were observed in experiment 1.\") then this information will not be exported (and will be lost!) when the data is exported as raw text. Every piece of data should be encoded as actual text that can be exported.\r\n\r\nThe instruction list/script\r\n\r\nYou may have heard this before, but reproducibility is kind of a big deal in computational science. That means, when you submit your paper, the reviewers and the rest of the world should be able to exactly replicate the analyses from raw data all the way to final results. If you are trying to be efficient, you will likely perform some summarization/data analysis steps before the data can be considered tidy.\r\n\r\nThe ideal thing for you to do when performing summarization is to create a computer script (in R, Python, or something else) that takes the raw data as input and produces the tidy data you are sharing as output. You can try running your script a couple of times and see if the code produces the same output.\r\n\r\nIn many cases, the person who collected the data has incentive to make it tidy for a statistician to speed the process of collaboration. They may not know how to code in a scripting language. In that case, what you should provide the statistician is something called pseudocode. It should look something like:\r\n\r\nStep 1 - take the raw file, run version 3.1.2 of summarize software with parameters a=1, b=2, c=3\r\nStep 2 - run the software separately for each sample\r\nStep 3 - take column three of outputfile.out for each sample and that is the corresponding row in the output data set\r\nYou should also include information about which system (Mac/Windows/Linux) you used the software on and whether you tried it more than once to confirm it gave the same results. Ideally, you will run this by a fellow student/labmate to confirm that they can obtain the same output file you did.\r\n\r\nWhat you should expect from the analyst\r\n\r\nWhen you turn over a properly tidied data set it dramatically decreases the workload on the statistician. So hopefully they will get back to you much sooner. But most careful statisticians will check your recipe, ask questions about steps you performed, and try to confirm that they can obtain the same tidy data that you did with, at minimum, spot checks.\r\n\r\nYou should then expect from the statistician:\r\n\r\nAn analysis script that performs each of the analyses (not just instructions)\r\nThe exact computer code they used to run the analysis\r\nAll output files/figures they generated.\r\nThis is the information you will use in the supplement to establish reproducibility and precision of your results. Each of the steps in the analysis should be clearly explained and you should ask questions when you don't understand what the analyst did. It is the responsibility of both the statistician and the scientist to understand the statistical analysis. You may not be able to perform the exact analyses without the statistician's code, but you should be able to explain why the statistician performed each step to a labmate/your principal investigator.\r\n\r\nContributors\r\n\r\nJeff Leek - Wrote the initial version.\r\nL. Collado-Torres - Fixed typos, added links.\r\nNick Reich - Added tips on storing data as text.","created_at":"2016-09-10T14:11:11Z","updated_at":"2016-09-10T14:11:32Z","closed_at":"2016-09-10T14:11:32Z","merged_at":null,"merge_commit_sha":"0758b288d0c0d1a749140a110297398593d4fb23","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aneesrana/datasharing/pulls/1/commits","review_comments_url":"https://api.github.com/repos/aneesrana/datasharing/pulls/1/comments","review_comment_url":"https://api.github.com/repos/aneesrana/datasharing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aneesrana/datasharing/issues/1/comments","statuses_url":"https://api.github.com/repos/aneesrana/datasharing/statuses/ce5562884ad431c9b8ad46a372c70e61d2b06643","head":{"label":"aneesrana:aneesrana-patch-1","ref":"aneesrana-patch-1","sha":"ce5562884ad431c9b8ad46a372c70e61d2b06643","user":{"login":"aneesrana","id":20018401,"avatar_url":"https://avatars.githubusercontent.com/u/20018401?v=3","gravatar_id":"","url":"https://api.github.com/users/aneesrana","html_url":"https://github.com/aneesrana","followers_url":"https://api.github.com/users/aneesrana/followers","following_url":"https://api.github.com/users/aneesrana/following{/other_user}","gists_url":"https://api.github.com/users/aneesrana/gists{/gist_id}","starred_url":"https://api.github.com/users/aneesrana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aneesrana/subscriptions","organizations_url":"https://api.github.com/users/aneesrana/orgs","repos_url":"https://api.github.com/users/aneesrana/repos","events_url":"https://api.github.com/users/aneesrana/events{/privacy}","received_events_url":"https://api.github.com/users/aneesrana/received_events","type":"User","site_admin":false},"repo":{"id":67768051,"name":"datasharing","full_name":"aneesrana/datasharing","owner":{"login":"aneesrana","id":20018401,"avatar_url":"https://avatars.githubusercontent.com/u/20018401?v=3","gravatar_id":"","url":"https://api.github.com/users/aneesrana","html_url":"https://github.com/aneesrana","followers_url":"https://api.github.com/users/aneesrana/followers","following_url":"https://api.github.com/users/aneesrana/following{/other_user}","gists_url":"https://api.github.com/users/aneesrana/gists{/gist_id}","starred_url":"https://api.github.com/users/aneesrana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aneesrana/subscriptions","organizations_url":"https://api.github.com/users/aneesrana/orgs","repos_url":"https://api.github.com/users/aneesrana/repos","events_url":"https://api.github.com/users/aneesrana/events{/privacy}","received_events_url":"https://api.github.com/users/aneesrana/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aneesrana/datasharing","description":"The Leek group guide to data sharing ","fork":true,"url":"https://api.github.com/repos/aneesrana/datasharing","forks_url":"https://api.github.com/repos/aneesrana/datasharing/forks","keys_url":"https://api.github.com/repos/aneesrana/datasharing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aneesrana/datasharing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aneesrana/datasharing/teams","hooks_url":"https://api.github.com/repos/aneesrana/datasharing/hooks","issue_events_url":"https://api.github.com/repos/aneesrana/datasharing/issues/events{/number}","events_url":"https://api.github.com/repos/aneesrana/datasharing/events","assignees_url":"https://api.github.com/repos/aneesrana/datasharing/assignees{/user}","branches_url":"https://api.github.com/repos/aneesrana/datasharing/branches{/branch}","tags_url":"https://api.github.com/repos/aneesrana/datasharing/tags","blobs_url":"https://api.github.com/repos/aneesrana/datasharing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aneesrana/datasharing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aneesrana/datasharing/git/refs{/sha}","trees_url":"https://api.github.com/repos/aneesrana/datasharing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aneesrana/datasharing/statuses/{sha}","languages_url":"https://api.github.com/repos/aneesrana/datasharing/languages","stargazers_url":"https://api.github.com/repos/aneesrana/datasharing/stargazers","contributors_url":"https://api.github.com/repos/aneesrana/datasharing/contributors","subscribers_url":"https://api.github.com/repos/aneesrana/datasharing/subscribers","subscription_url":"https://api.github.com/repos/aneesrana/datasharing/subscription","commits_url":"https://api.github.com/repos/aneesrana/datasharing/commits{/sha}","git_commits_url":"https://api.github.com/repos/aneesrana/datasharing/git/commits{/sha}","comments_url":"https://api.github.com/repos/aneesrana/datasharing/comments{/number}","issue_comment_url":"https://api.github.com/repos/aneesrana/datasharing/issues/comments{/number}","contents_url":"https://api.github.com/repos/aneesrana/datasharing/contents/{+path}","compare_url":"https://api.github.com/repos/aneesrana/datasharing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aneesrana/datasharing/merges","archive_url":"https://api.github.com/repos/aneesrana/datasharing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aneesrana/datasharing/downloads","issues_url":"https://api.github.com/repos/aneesrana/datasharing/issues{/number}","pulls_url":"https://api.github.com/repos/aneesrana/datasharing/pulls{/number}","milestones_url":"https://api.github.com/repos/aneesrana/datasharing/milestones{/number}","notifications_url":"https://api.github.com/repos/aneesrana/datasharing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aneesrana/datasharing/labels{/name}","releases_url":"https://api.github.com/repos/aneesrana/datasharing/releases{/id}","deployments_url":"https://api.github.com/repos/aneesrana/datasharing/deployments","created_at":"2016-09-09T05:18:57Z","updated_at":"2016-09-09T00:46:25Z","pushed_at":"2016-09-10T14:11:11Z","git_url":"git://github.com/aneesrana/datasharing.git","ssh_url":"git@github.com:aneesrana/datasharing.git","clone_url":"https://github.com/aneesrana/datasharing.git","svn_url":"https://github.com/aneesrana/datasharing","homepage":null,"size":547,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"aneesrana:master","ref":"master","sha":"c179250410139c62c1af03fafa4916822de8b30a","user":{"login":"aneesrana","id":20018401,"avatar_url":"https://avatars.githubusercontent.com/u/20018401?v=3","gravatar_id":"","url":"https://api.github.com/users/aneesrana","html_url":"https://github.com/aneesrana","followers_url":"https://api.github.com/users/aneesrana/followers","following_url":"https://api.github.com/users/aneesrana/following{/other_user}","gists_url":"https://api.github.com/users/aneesrana/gists{/gist_id}","starred_url":"https://api.github.com/users/aneesrana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aneesrana/subscriptions","organizations_url":"https://api.github.com/users/aneesrana/orgs","repos_url":"https://api.github.com/users/aneesrana/repos","events_url":"https://api.github.com/users/aneesrana/events{/privacy}","received_events_url":"https://api.github.com/users/aneesrana/received_events","type":"User","site_admin":false},"repo":{"id":67768051,"name":"datasharing","full_name":"aneesrana/datasharing","owner":{"login":"aneesrana","id":20018401,"avatar_url":"https://avatars.githubusercontent.com/u/20018401?v=3","gravatar_id":"","url":"https://api.github.com/users/aneesrana","html_url":"https://github.com/aneesrana","followers_url":"https://api.github.com/users/aneesrana/followers","following_url":"https://api.github.com/users/aneesrana/following{/other_user}","gists_url":"https://api.github.com/users/aneesrana/gists{/gist_id}","starred_url":"https://api.github.com/users/aneesrana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aneesrana/subscriptions","organizations_url":"https://api.github.com/users/aneesrana/orgs","repos_url":"https://api.github.com/users/aneesrana/repos","events_url":"https://api.github.com/users/aneesrana/events{/privacy}","received_events_url":"https://api.github.com/users/aneesrana/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aneesrana/datasharing","description":"The Leek group guide to data sharing ","fork":true,"url":"https://api.github.com/repos/aneesrana/datasharing","forks_url":"https://api.github.com/repos/aneesrana/datasharing/forks","keys_url":"https://api.github.com/repos/aneesrana/datasharing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aneesrana/datasharing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aneesrana/datasharing/teams","hooks_url":"https://api.github.com/repos/aneesrana/datasharing/hooks","issue_events_url":"https://api.github.com/repos/aneesrana/datasharing/issues/events{/number}","events_url":"https://api.github.com/repos/aneesrana/datasharing/events","assignees_url":"https://api.github.com/repos/aneesrana/datasharing/assignees{/user}","branches_url":"https://api.github.com/repos/aneesrana/datasharing/branches{/branch}","tags_url":"https://api.github.com/repos/aneesrana/datasharing/tags","blobs_url":"https://api.github.com/repos/aneesrana/datasharing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aneesrana/datasharing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aneesrana/datasharing/git/refs{/sha}","trees_url":"https://api.github.com/repos/aneesrana/datasharing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aneesrana/datasharing/statuses/{sha}","languages_url":"https://api.github.com/repos/aneesrana/datasharing/languages","stargazers_url":"https://api.github.com/repos/aneesrana/datasharing/stargazers","contributors_url":"https://api.github.com/repos/aneesrana/datasharing/contributors","subscribers_url":"https://api.github.com/repos/aneesrana/datasharing/subscribers","subscription_url":"https://api.github.com/repos/aneesrana/datasharing/subscription","commits_url":"https://api.github.com/repos/aneesrana/datasharing/commits{/sha}","git_commits_url":"https://api.github.com/repos/aneesrana/datasharing/git/commits{/sha}","comments_url":"https://api.github.com/repos/aneesrana/datasharing/comments{/number}","issue_comment_url":"https://api.github.com/repos/aneesrana/datasharing/issues/comments{/number}","contents_url":"https://api.github.com/repos/aneesrana/datasharing/contents/{+path}","compare_url":"https://api.github.com/repos/aneesrana/datasharing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aneesrana/datasharing/merges","archive_url":"https://api.github.com/repos/aneesrana/datasharing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aneesrana/datasharing/downloads","issues_url":"https://api.github.com/repos/aneesrana/datasharing/issues{/number}","pulls_url":"https://api.github.com/repos/aneesrana/datasharing/pulls{/number}","milestones_url":"https://api.github.com/repos/aneesrana/datasharing/milestones{/number}","notifications_url":"https://api.github.com/repos/aneesrana/datasharing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aneesrana/datasharing/labels{/name}","releases_url":"https://api.github.com/repos/aneesrana/datasharing/releases{/id}","deployments_url":"https://api.github.com/repos/aneesrana/datasharing/deployments","created_at":"2016-09-09T05:18:57Z","updated_at":"2016-09-09T00:46:25Z","pushed_at":"2016-09-10T14:11:11Z","git_url":"git://github.com/aneesrana/datasharing.git","ssh_url":"git@github.com:aneesrana/datasharing.git","clone_url":"https://github.com/aneesrana/datasharing.git","svn_url":"https://github.com/aneesrana/datasharing","homepage":null,"size":547,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aneesrana/datasharing/pulls/1"},"html":{"href":"https://github.com/aneesrana/datasharing/pull/1"},"issue":{"href":"https://api.github.com/repos/aneesrana/datasharing/issues/1"},"comments":{"href":"https://api.github.com/repos/aneesrana/datasharing/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/aneesrana/datasharing/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/aneesrana/datasharing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aneesrana/datasharing/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/aneesrana/datasharing/statuses/ce5562884ad431c9b8ad46a372c70e61d2b06643"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":0,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"aneesrana"}}