{"id":550,"date":"2017-07-02T12:03:17","date_gmt":"2017-07-02T04:03:17","guid":{"rendered":"https:\/\/www.beneplot.com\/?p=550"},"modified":"2020-07-16T14:00:43","modified_gmt":"2020-07-16T06:00:43","slug":"%e5%8c%ba%e5%88%86%e5%ba%a6%e8%ae%a1%e7%ae%97%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/www.beneplot.com\/?p=550","title":{"rendered":"\u533a\u5206\u5ea6\u8ba1\u7b97\u4ee3\u7801"},"content":{"rendered":"<h2>\u672c\u6587\u5c06\u8bb2\u8ff0\u5982\u4f55\u901a\u8fc7R\u8bed\u8a00\u8ba1\u7b97item\u7684\u533a\u5206\u5ea6\u3002<\/h2>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">setwd(\"C:\\\\...\")###\u8bbe\u5b9a\u5206\u6790\u6587\u6863\u6240\u5728\u76ee\u5f55###<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">resp = read.csv(\"data.csv\",row.names = 1)###data.csv\u4e3a\u6d4b\u8bd5\u8005\u4f5c\u7b54\u5f97\u5206\u6570\u636e\u8868\uff1b\u662f1\u4e2a\u6570\u636e\u77e9\u9635###<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">library(TAM)###\u8f7d\u5165IRT\u5206\u6790\u5305###<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">mod1 = tam(resp)###\u8fdb\u884cIRT\u5206\u6790###<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">Abil = tam.wle(mod1)###\u6c42\u6d4b\u8bd5\u8005\u7684\u80fd\u529b\u503c###<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">PersonAbility = Abil$theta<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">PersonAbility###PersonAbility\u4e3a\u6839\u636e\u4f5c\u7b54\u6570\u636e\u6c42\u51fa\u7684\u6d4b\u8bd5\u8005\u80fd\u529b\u503c\uff0c\u4e3a1\u5217\u6570\u636e###<\/span><\/code><\/span><\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">#######################################<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">##############\u533a\u5206\u5ea6\uff08\u76f8\u5173\u6cd5\uff09#############<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">#######################################<\/span><\/code><\/span><\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">##\u533a\u5206\u5ea6\uff08\u76f8\u5173\u6cd5\uff09- \u5373\u6c42\u80fd\u529b\u503c\u4e0e\u5b9e\u9645\u4f5c\u7b54\u7684\u76f8\u5173##<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">discrim = cor(resp,PersonAbility,use=\"complete.ob\")##discrim\u5373\u6c42\u51fa\u7684\u533a\u5206\u5ea6\uff0c\u4e3a1\u5217\u6570\u636e##<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">discrim###discrim\u4e3a\u6c42\u51fa\u7684\u80fd\u529b\u503c\u76f8\u5173\u533a\u5206\u5ea6\uff0c\u4e3a1\u5217\u6570\u636e###<\/span><\/code><\/span><\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">##\u533a\u5206\u5ea6\uff08\u76f8\u5173\u6cd5\uff09- \u5373\u6c42\u5b9e\u9645\u6240\u6709\u9898\u7684\u603b\u5f97\u5206\u4e0e\u67d0\u9053\u9898\u4f5c\u7b54\u5f97\u5206\u7684\u76f8\u5173##<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">row.sums = apply(resp,1,sum,na.rm = TRUE)###\u6c42\u6bcf\u4eba\u5728\u6240\u6709\u9898\u7684\u603b\u5f97\u5206\uff0c\u4e3a1\u5217\u6570\u636e###<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">disob = cor(resp,row.sums,use=\"complete.ob\")##disob\u5373\u4e3a\u6c42\u51fa\u7684\u533a\u5206\u5ea6##<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">disob###disob\u4e3a\u6c42\u51fa\u7684\u603b\u5206\u76f8\u5173\u533a\u5206\u5ea6\uff0c\u4e3a1\u5217\u6570\u636e###<\/span><\/code><\/span><\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">#######################################<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">##########\u533a\u5206\u5ea6\uff08\u9274\u522b\u6cd5\uff09#############<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">#######################################<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">###\u533a\u5206\u5ea6\uff08\u9274\u522b\u6cd5\uff09\u5373\u901a\u8fc7\u8ba1\u7b97\u9ad8\u5206\u7ec4\u6d4b\u8bd5\u8005\u4e0e\u4f4e\u5206\u7ec4\u6d4b\u8bd5\u8005\u7684\u8868\u73b0\u5dee\u5f02\u6765\u5b9a\u4e49\u533a\u5206\u5ea6####<\/span><\/code><\/span><\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">low = quantile(row.sums, probs = 0.27, na.rm = TRUE,names = TRUE)######\u5c06\u5f97\u5206\u5728\u540e27%\u7684\u4eba\u8bbe\u4e3a\u4f4e\u5206\u7ec4\uff0c\u8be5\u6570\u503c\u53ef\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u81ea\u884c\u8bbe\u5b9a##<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">high = quantile(row.sums, probs = 0.73, na.rm = TRUE,names = TRUE)######\u5c06\u5f97\u5206\u5728\u524d27%\u7684\u4eba\u8bbe\u4e3a\u9ad8\u5206\u5206\u7ec4\uff0c\u8be5\u6570\u503c\u53ef\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u81ea\u884c\u8bbe\u5b9a##<\/span><\/code><\/span><\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">toresp = cbind(resp,row.sums)<\/span><\/code><\/span><\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">lowl = ifelse(toresp$row.sums&lt;low,1,0)<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">highl = ifelse(toresp$row.sums&gt;high,1,0)<\/span><\/code><\/span><\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">hilo=cbind(toresp,lowl,highl)<\/span><\/code><\/span><\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">diss = NULL<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">dis = list()<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">for (i in 1:ncol(resp)){<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">\u00a0 meanm = tapply(resp[,i], list(lowl, highl), mean, na.rm=TRUE)<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">\u00a0 lmean = meanm[2,1]<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">\u00a0 hmean = meanm[1,2]<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">\u00a0 max = max(resp[,i], na.rm=TRUE)<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">\u00a0 l = lmean\/max<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">\u00a0 h = hmean\/max<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">\u00a0 dis[[i]] = h-l<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">\u00a0 diss = rbind(diss,dis[[i]])<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">}<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">diss##diss\u5373\u4e3a\u6c42\u51fa\u7684\u9274\u522b\u6cd5\u533a\u5206\u5ea6\uff0c\u4e3a1\u5217\u6570\u636e##<\/span><\/code><\/span><\/div>\n<div>\u00a0<\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">result = cbind(diss,discrim,disob)##\u5c06\u6c42\u51fa\u7684\u4e09\u79cd\u533a\u5206\u5ea6\u653e\u5728\u4e00\u4e2a\u8868\u683c\u4e2d###<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">colnames(result) = c(\"diss\",\"discrim\",\"disob\")##\u7ed9\u5404\u5217\u547d\u540d###<\/span><\/code><\/span><\/div>\n<div><span style=\"font-family: 'times new roman', times, serif;\"><code><span style=\"font-size: 16px;\">write.csv(result,\"result.csv\")###\u5bfc\u51fa\u7ed3\u679c####<\/span><\/code><\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u5c06\u8bb2\u8ff0\u5982\u4f55\u901a\u8fc7R\u8bed\u8a00\u8ba1\u7b97item\u7684\u533a\u5206\u5ea6\u3002 \u00a0 \u00a0 setwd(&#8220;C:\\\\&#8230;&#8221;)###\u8bbe\u5b9a\u5206\u6790\u6587\u6863\u6240\u5728 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v14.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.beneplot.com\/?p=550\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u533a\u5206\u5ea6\u8ba1\u7b97\u4ee3\u7801 - Beneplot\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6587\u5c06\u8bb2\u8ff0\u5982\u4f55\u901a\u8fc7R\u8bed\u8a00\u8ba1\u7b97item\u7684\u533a\u5206\u5ea6\u3002 \u00a0 \u00a0 setwd(&quot;C:\\\\...&quot;)###\u8bbe\u5b9a\u5206\u6790\u6587\u6863\u6240\u5728 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.beneplot.com\/?p=550\" \/>\n<meta property=\"og:site_name\" content=\"Beneplot\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-02T04:03:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-07-16T06:00:43+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.beneplot.com\/#website\",\"url\":\"https:\/\/www.beneplot.com\/\",\"name\":\"Beneplot\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.beneplot.com\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-CN\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.beneplot.com\/?p=550#webpage\",\"url\":\"https:\/\/www.beneplot.com\/?p=550\",\"name\":\"\\u533a\\u5206\\u5ea6\\u8ba1\\u7b97\\u4ee3\\u7801 - Beneplot\",\"isPartOf\":{\"@id\":\"https:\/\/www.beneplot.com\/#website\"},\"datePublished\":\"2017-07-02T04:03:17+00:00\",\"dateModified\":\"2020-07-16T06:00:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.beneplot.com\/#\/schema\/person\/ea14f85ae789ceaaa712ceee1dd1f95b\"},\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.beneplot.com\/?p=550\"]}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/www.beneplot.com\/#\/schema\/person\/ea14f85ae789ceaaa712ceee1dd1f95b\",\"name\":\"beneplot\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.beneplot.com\/#personlogo\",\"inLanguage\":\"zh-CN\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/15d96ce801cfddbd59ef2b0d986cd9b1?s=96&r=g\",\"caption\":\"beneplot\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.beneplot.com\/index.php?rest_route=\/wp\/v2\/posts\/550"}],"collection":[{"href":"https:\/\/www.beneplot.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beneplot.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beneplot.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beneplot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=550"}],"version-history":[{"count":5,"href":"https:\/\/www.beneplot.com\/index.php?rest_route=\/wp\/v2\/posts\/550\/revisions"}],"predecessor-version":[{"id":643,"href":"https:\/\/www.beneplot.com\/index.php?rest_route=\/wp\/v2\/posts\/550\/revisions\/643"}],"wp:attachment":[{"href":"https:\/\/www.beneplot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beneplot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beneplot.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}