{"action":"created","issue":{"url":"https://api.github.com/repos/philchalmers/mirt/issues/40","labels_url":"https://api.github.com/repos/philchalmers/mirt/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/philchalmers/mirt/issues/40/comments","events_url":"https://api.github.com/repos/philchalmers/mirt/issues/40/events","html_url":"https://github.com/philchalmers/mirt/issues/40","id":73345712,"number":40,"title":"Crossvalidation","user":{"login":"thersites9","id":11835254,"avatar_url":"https://avatars.githubusercontent.com/u/11835254?v=3","gravatar_id":"","url":"https://api.github.com/users/thersites9","html_url":"https://github.com/thersites9","followers_url":"https://api.github.com/users/thersites9/followers","following_url":"https://api.github.com/users/thersites9/following{/other_user}","gists_url":"https://api.github.com/users/thersites9/gists{/gist_id}","starred_url":"https://api.github.com/users/thersites9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thersites9/subscriptions","organizations_url":"https://api.github.com/users/thersites9/orgs","repos_url":"https://api.github.com/users/thersites9/repos","events_url":"https://api.github.com/users/thersites9/events{/privacy}","received_events_url":"https://api.github.com/users/thersites9/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-05T15:26:58Z","updated_at":"2015-05-06T07:00:50Z","closed_at":null,"body":"Hi,\r\n\r\nI've been trying to cross-validate an estimated model. I guess the respective functionality is implemented? However, I seem to stumble into an error:\r\n\r\n```\r\n# example data\r\ndat <- expand.table(deAyala)\r\n\r\n# generate two subsamples\r\nset.seed(1529)\r\nsel <- sample(nrow(dat), 10000, replace=F)\r\nd1 <- dat[sel,]   # calibaration sample\r\nd2 <- dat[-sel,]  # validation sample\r\n\r\n# estimate model based on subsample d1\r\nfit <- mirt(d1, model= mirt.model('G = 1-5'), itemtype=\"2PL\")\r\n\r\n# estimate thetas for subsample d2\r\nfs <- fscores(fit, full.scores=T, scores.only=T, response.pattern=d2)\r\n```\r\nNote that the argument `scores.only` is ignored when specifying a `response.pattern`.\r\n\r\nThe following works fine:\r\n```\r\n# item fit for subsample 1 (calibration sample)\r\nitemfit(fit)\r\nresiduals(fit, type=\"Q3\")\r\n```\r\n\r\nHowever, this won't work:\r\n\r\n```\r\n# item fit for subsample 2 (validation sample)\r\nitemfit(fit, Theta=fs[,\"F1\"])\r\nresiduals(fit, type=\"Q3\", Theta=fs[,\"F1\"])\r\n```\r\nActually `residuals` produecs a series of warnings. Did I misunderstand the function or is there a glitch?\r\n\r\nBest, Timo"},"comment":{"url":"https://api.github.com/repos/philchalmers/mirt/issues/comments/99347459","html_url":"https://github.com/philchalmers/mirt/issues/40#issuecomment-99347459","issue_url":"https://api.github.com/repos/philchalmers/mirt/issues/40","id":99347459,"user":{"login":"thersites9","id":11835254,"avatar_url":"https://avatars.githubusercontent.com/u/11835254?v=3","gravatar_id":"","url":"https://api.github.com/users/thersites9","html_url":"https://github.com/thersites9","followers_url":"https://api.github.com/users/thersites9/followers","following_url":"https://api.github.com/users/thersites9/following{/other_user}","gists_url":"https://api.github.com/users/thersites9/gists{/gist_id}","starred_url":"https://api.github.com/users/thersites9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thersites9/subscriptions","organizations_url":"https://api.github.com/users/thersites9/orgs","repos_url":"https://api.github.com/users/thersites9/repos","events_url":"https://api.github.com/users/thersites9/events{/privacy}","received_events_url":"https://api.github.com/users/thersites9/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T07:00:50Z","updated_at":"2015-05-06T07:00:50Z","body":"Thanks for the clarification. Obviously, there was a misinterpretation on my part.\r\n\r\nBest, Timo"}}