{"action":"created","issue":{"url":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/1918","repository_url":"https://api.github.com/repos/africanmathsinitiative/Instat","labels_url":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/1918/labels{/name}","comments_url":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/1918/comments","events_url":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/1918/events","html_url":"https://github.com/africanmathsinitiative/Instat/issues/1918","id":183609503,"number":1918,"title":"surveys, missing values and SPSS import into R-Instat","user":{"login":"rdstern","id":11226469,"avatar_url":"https://avatars.githubusercontent.com/u/11226469?v=3","gravatar_id":"","url":"https://api.github.com/users/rdstern","html_url":"https://github.com/rdstern","followers_url":"https://api.github.com/users/rdstern/followers","following_url":"https://api.github.com/users/rdstern/following{/other_user}","gists_url":"https://api.github.com/users/rdstern/gists{/gist_id}","starred_url":"https://api.github.com/users/rdstern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdstern/subscriptions","organizations_url":"https://api.github.com/users/rdstern/orgs","repos_url":"https://api.github.com/users/rdstern/repos","events_url":"https://api.github.com/users/rdstern/events{/privacy}","received_events_url":"https://api.github.com/users/rdstern/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"volloholic","id":11214506,"avatar_url":"https://avatars.githubusercontent.com/u/11214506?v=3","gravatar_id":"","url":"https://api.github.com/users/volloholic","html_url":"https://github.com/volloholic","followers_url":"https://api.github.com/users/volloholic/followers","following_url":"https://api.github.com/users/volloholic/following{/other_user}","gists_url":"https://api.github.com/users/volloholic/gists{/gist_id}","starred_url":"https://api.github.com/users/volloholic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volloholic/subscriptions","organizations_url":"https://api.github.com/users/volloholic/orgs","repos_url":"https://api.github.com/users/volloholic/repos","events_url":"https://api.github.com/users/volloholic/events{/privacy}","received_events_url":"https://api.github.com/users/volloholic/received_events","type":"User","site_admin":false},"assignees":[{"login":"volloholic","id":11214506,"avatar_url":"https://avatars.githubusercontent.com/u/11214506?v=3","gravatar_id":"","url":"https://api.github.com/users/volloholic","html_url":"https://github.com/volloholic","followers_url":"https://api.github.com/users/volloholic/followers","following_url":"https://api.github.com/users/volloholic/following{/other_user}","gists_url":"https://api.github.com/users/volloholic/gists{/gist_id}","starred_url":"https://api.github.com/users/volloholic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volloholic/subscriptions","organizations_url":"https://api.github.com/users/volloholic/orgs","repos_url":"https://api.github.com/users/volloholic/repos","events_url":"https://api.github.com/users/volloholic/events{/privacy}","received_events_url":"https://api.github.com/users/volloholic/received_events","type":"User","site_admin":false},{"login":"dannyparsons","id":11214914,"avatar_url":"https://avatars.githubusercontent.com/u/11214914?v=3","gravatar_id":"","url":"https://api.github.com/users/dannyparsons","html_url":"https://github.com/dannyparsons","followers_url":"https://api.github.com/users/dannyparsons/followers","following_url":"https://api.github.com/users/dannyparsons/following{/other_user}","gists_url":"https://api.github.com/users/dannyparsons/gists{/gist_id}","starred_url":"https://api.github.com/users/dannyparsons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dannyparsons/subscriptions","organizations_url":"https://api.github.com/users/dannyparsons/orgs","repos_url":"https://api.github.com/users/dannyparsons/repos","events_url":"https://api.github.com/users/dannyparsons/events{/privacy}","received_events_url":"https://api.github.com/users/dannyparsons/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-10-18T07:27:59Z","updated_at":"2016-10-31T16:05:22Z","closed_at":null,"body":"During our discussions with SSD we were asked about:\na) Importing into SPSS including value labels\nb) Coping with multiple \"missing\" values or special codes in surveys, e.g. 1, 2, 3, 77=Don't know, 88=Refused, 99=Absent.\n\nThere is a good discussion of the multiple missing value issue here:\nhttp://stackoverflow.com/questions/16074384/specify-different-types-of-missing-values-nas\n\nThat also mentions the **memisc** package, which seems interesting as follows:\n\na) It discusses importing from SPSS in detail, including labels in a useful vignette.\nb) It explicitly discusses its way of dealing with multiple missing values.\nc) It includes specific added metadata for surveys - including the question!\nd) It also seems potentially useful on tabulation\n\nThe SSD staff pointed us towards the survey package, but that is much more advanced - mainly on modelling (taking account of the design), which is useful, but at a more advanced level.  This package looks much more relevant for the basic SPSS-type survey tasks, and seemingly with a set of simple commands.\nIt says it is: Tools for Management of Survey Data and the Presentation of Analysis Results\nAnd the description is as follows:\n\n\"One of the aims of this package is to make life easier for R users who deal with survey data sets. It provides an infrastructure for the management of survey data including value labels, definable missing values, recoding of variables, production of code books, and import of (subsets of) 'SPSS' and 'Stata' files. Further, it provides functionality to produce tables and data frames of arbitrary descriptive statistics and (almost) publication-ready tables of regression model estimates, which can be exported to 'LaTeX' and HTML.\"\n\nOne of the examples is:\n\nvote <- sample(c(1,2,3,8,9,97,99),size=30,replace=TRUE)\nlabels(vote) <- c(Conservatives = 1,\nLabour = 2,\n\"Liberal Democrats\" = 3,\n\"Don't know\" = 8,\n\"Answer refused\" = 9,\n\"Not applicable\" = 97,\n\"Not asked in survey\" = 99\n)\nmissing.values(vote) <- c(97,99)\ndescription(vote) <- \"Vote intention\"\nwording(vote) <- \"If a general election would take place next Tuesday,which party would you vote for?\"\nannotation(vote)\nannotation(vote)[\"Remark\"] <- \"This is not a real questionnaire item, of course ...\"\ncodebook(vote)\n\nRDS\n"},"comment":{"url":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/comments/257336636","html_url":"https://github.com/africanmathsinitiative/Instat/issues/1918#issuecomment-257336636","issue_url":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/1918","id":257336636,"user":{"login":"rdstern","id":11226469,"avatar_url":"https://avatars.githubusercontent.com/u/11226469?v=3","gravatar_id":"","url":"https://api.github.com/users/rdstern","html_url":"https://github.com/rdstern","followers_url":"https://api.github.com/users/rdstern/followers","following_url":"https://api.github.com/users/rdstern/following{/other_user}","gists_url":"https://api.github.com/users/rdstern/gists{/gist_id}","starred_url":"https://api.github.com/users/rdstern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdstern/subscriptions","organizations_url":"https://api.github.com/users/rdstern/orgs","repos_url":"https://api.github.com/users/rdstern/repos","events_url":"https://api.github.com/users/rdstern/events{/privacy}","received_events_url":"https://api.github.com/users/rdstern/received_events","type":"User","site_admin":false},"created_at":"2016-10-31T16:05:22Z","updated_at":"2016-10-31T16:05:22Z","body":"[M2 data.zip](https://github.com/africanmathsinitiative/Instat/files/562203/M2.data.zip)\r\n\r\nHere is an example of a data file to import from SPSS.\r\n\r\nWhen I tried it seems to import sort of OK.  But nothing comes as factors, it is character or numeric.  I suppose that is OK.  But the 4th column (E_DATE) is a date and comes as a character.  I tried making it into a date.  The first time I omitted the format of the column and it crashed R-Instat.  The second time it appeared to work, but the column is still character.\r\n\r\nThe column S_DATE seems very odd.  \r\n\r\nI also tried putting the data back into SPSS and found it came in exactly the same way and there were problems there too - perhaps this is a tough one.      \r\n\r\nI'll also look for simpler data sets.\r\n\r\nRoger"}}
{"actor":{"display_login":"rdstern"}}