How to get value of fitted curve from an IRT model at specific point in R?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















So I have some data that I fit a IRT graded response model to, using this code:



hdat <- read.csv("data.csv", header=TRUE)


library("mirt")


model.grm <- 'height = 1-9'
results.grm <- mirt(data=hdat, model=model.grm, itemtype="graded", SE=TRUE, verbose=FALSE)
coef.grm <- coef(results.grm, IRTpars=TRUE, simplify=TRUE)
items.grm <- as.data.frame(coef.grm$items)
print(items.grm)

png(filename="plot.png")

plot(results.grm, type = 'trace', which.items = c(1),
main = "", par.settings = simpleTheme(lty=1:4,lwd=2),
auto.key=list(points=FALSE,lines=TRUE, columns=4))

dev.off()


And I get this graph:



graph



How do I find out the value of say, P2 at theta = -1?



The object being graphed I think is results.grm@ParObjects$pars[[1]] which has these contents:



Formal class 'graded' [package "mirt"] with 23 slots
..@ par : num [1:5] 4.888 2.815 0.561 -1.728 -5.509
..@ SEpar : num [1:5] 0.0421 0.0311 0.0252 0.0279 0.0472
..@ parnames : chr [1:5] "a1" "d1" "d2" "d3" ...
..@ est : Named logi [1:5] TRUE TRUE TRUE TRUE TRUE
.. ..- attr(*, "names")= chr [1:5] "a1" "d1" "d2" "d3" ...
..@ dps :function ()
..@ dps2 :function ()
..@ constr : logi(0)
..@ itemclass : int 2
..@ parnum : Named int [1:5] 1 2 3 4 5
.. ..- attr(*, "names")= chr [1:5] "a1" "d1" "d2" "d3" ...
..@ nfact : int 1
..@ nfixedeffects: num 0
..@ fixed.design : num [1, 1] 0
..@ dat : num [1, 1] 0
..@ ncat : int 5
..@ gradient : num(0)
..@ hessian : num [1:5, 1:5] -4814 1846 362 -1200 -2266 ...
..@ itemtrace : num[0 , 0 ]
..@ lbound : num [1:5] -Inf -Inf -Inf -Inf -Inf
..@ ubound : num [1:5] Inf Inf Inf Inf Inf
..@ any.prior : logi FALSE
..@ prior.type : int [1:5] 0 0 0 0 0
..@ prior_1 : num [1:5] NaN NaN NaN NaN NaN
..@ prior_2 : num [1:5] NaN NaN NaN NaN NaN









share|improve this question































    0















    So I have some data that I fit a IRT graded response model to, using this code:



    hdat <- read.csv("data.csv", header=TRUE)


    library("mirt")


    model.grm <- 'height = 1-9'
    results.grm <- mirt(data=hdat, model=model.grm, itemtype="graded", SE=TRUE, verbose=FALSE)
    coef.grm <- coef(results.grm, IRTpars=TRUE, simplify=TRUE)
    items.grm <- as.data.frame(coef.grm$items)
    print(items.grm)

    png(filename="plot.png")

    plot(results.grm, type = 'trace', which.items = c(1),
    main = "", par.settings = simpleTheme(lty=1:4,lwd=2),
    auto.key=list(points=FALSE,lines=TRUE, columns=4))

    dev.off()


    And I get this graph:



    graph



    How do I find out the value of say, P2 at theta = -1?



    The object being graphed I think is results.grm@ParObjects$pars[[1]] which has these contents:



    Formal class 'graded' [package "mirt"] with 23 slots
    ..@ par : num [1:5] 4.888 2.815 0.561 -1.728 -5.509
    ..@ SEpar : num [1:5] 0.0421 0.0311 0.0252 0.0279 0.0472
    ..@ parnames : chr [1:5] "a1" "d1" "d2" "d3" ...
    ..@ est : Named logi [1:5] TRUE TRUE TRUE TRUE TRUE
    .. ..- attr(*, "names")= chr [1:5] "a1" "d1" "d2" "d3" ...
    ..@ dps :function ()
    ..@ dps2 :function ()
    ..@ constr : logi(0)
    ..@ itemclass : int 2
    ..@ parnum : Named int [1:5] 1 2 3 4 5
    .. ..- attr(*, "names")= chr [1:5] "a1" "d1" "d2" "d3" ...
    ..@ nfact : int 1
    ..@ nfixedeffects: num 0
    ..@ fixed.design : num [1, 1] 0
    ..@ dat : num [1, 1] 0
    ..@ ncat : int 5
    ..@ gradient : num(0)
    ..@ hessian : num [1:5, 1:5] -4814 1846 362 -1200 -2266 ...
    ..@ itemtrace : num[0 , 0 ]
    ..@ lbound : num [1:5] -Inf -Inf -Inf -Inf -Inf
    ..@ ubound : num [1:5] Inf Inf Inf Inf Inf
    ..@ any.prior : logi FALSE
    ..@ prior.type : int [1:5] 0 0 0 0 0
    ..@ prior_1 : num [1:5] NaN NaN NaN NaN NaN
    ..@ prior_2 : num [1:5] NaN NaN NaN NaN NaN









    share|improve this question



























      0












      0








      0








      So I have some data that I fit a IRT graded response model to, using this code:



      hdat <- read.csv("data.csv", header=TRUE)


      library("mirt")


      model.grm <- 'height = 1-9'
      results.grm <- mirt(data=hdat, model=model.grm, itemtype="graded", SE=TRUE, verbose=FALSE)
      coef.grm <- coef(results.grm, IRTpars=TRUE, simplify=TRUE)
      items.grm <- as.data.frame(coef.grm$items)
      print(items.grm)

      png(filename="plot.png")

      plot(results.grm, type = 'trace', which.items = c(1),
      main = "", par.settings = simpleTheme(lty=1:4,lwd=2),
      auto.key=list(points=FALSE,lines=TRUE, columns=4))

      dev.off()


      And I get this graph:



      graph



      How do I find out the value of say, P2 at theta = -1?



      The object being graphed I think is results.grm@ParObjects$pars[[1]] which has these contents:



      Formal class 'graded' [package "mirt"] with 23 slots
      ..@ par : num [1:5] 4.888 2.815 0.561 -1.728 -5.509
      ..@ SEpar : num [1:5] 0.0421 0.0311 0.0252 0.0279 0.0472
      ..@ parnames : chr [1:5] "a1" "d1" "d2" "d3" ...
      ..@ est : Named logi [1:5] TRUE TRUE TRUE TRUE TRUE
      .. ..- attr(*, "names")= chr [1:5] "a1" "d1" "d2" "d3" ...
      ..@ dps :function ()
      ..@ dps2 :function ()
      ..@ constr : logi(0)
      ..@ itemclass : int 2
      ..@ parnum : Named int [1:5] 1 2 3 4 5
      .. ..- attr(*, "names")= chr [1:5] "a1" "d1" "d2" "d3" ...
      ..@ nfact : int 1
      ..@ nfixedeffects: num 0
      ..@ fixed.design : num [1, 1] 0
      ..@ dat : num [1, 1] 0
      ..@ ncat : int 5
      ..@ gradient : num(0)
      ..@ hessian : num [1:5, 1:5] -4814 1846 362 -1200 -2266 ...
      ..@ itemtrace : num[0 , 0 ]
      ..@ lbound : num [1:5] -Inf -Inf -Inf -Inf -Inf
      ..@ ubound : num [1:5] Inf Inf Inf Inf Inf
      ..@ any.prior : logi FALSE
      ..@ prior.type : int [1:5] 0 0 0 0 0
      ..@ prior_1 : num [1:5] NaN NaN NaN NaN NaN
      ..@ prior_2 : num [1:5] NaN NaN NaN NaN NaN









      share|improve this question
















      So I have some data that I fit a IRT graded response model to, using this code:



      hdat <- read.csv("data.csv", header=TRUE)


      library("mirt")


      model.grm <- 'height = 1-9'
      results.grm <- mirt(data=hdat, model=model.grm, itemtype="graded", SE=TRUE, verbose=FALSE)
      coef.grm <- coef(results.grm, IRTpars=TRUE, simplify=TRUE)
      items.grm <- as.data.frame(coef.grm$items)
      print(items.grm)

      png(filename="plot.png")

      plot(results.grm, type = 'trace', which.items = c(1),
      main = "", par.settings = simpleTheme(lty=1:4,lwd=2),
      auto.key=list(points=FALSE,lines=TRUE, columns=4))

      dev.off()


      And I get this graph:



      graph



      How do I find out the value of say, P2 at theta = -1?



      The object being graphed I think is results.grm@ParObjects$pars[[1]] which has these contents:



      Formal class 'graded' [package "mirt"] with 23 slots
      ..@ par : num [1:5] 4.888 2.815 0.561 -1.728 -5.509
      ..@ SEpar : num [1:5] 0.0421 0.0311 0.0252 0.0279 0.0472
      ..@ parnames : chr [1:5] "a1" "d1" "d2" "d3" ...
      ..@ est : Named logi [1:5] TRUE TRUE TRUE TRUE TRUE
      .. ..- attr(*, "names")= chr [1:5] "a1" "d1" "d2" "d3" ...
      ..@ dps :function ()
      ..@ dps2 :function ()
      ..@ constr : logi(0)
      ..@ itemclass : int 2
      ..@ parnum : Named int [1:5] 1 2 3 4 5
      .. ..- attr(*, "names")= chr [1:5] "a1" "d1" "d2" "d3" ...
      ..@ nfact : int 1
      ..@ nfixedeffects: num 0
      ..@ fixed.design : num [1, 1] 0
      ..@ dat : num [1, 1] 0
      ..@ ncat : int 5
      ..@ gradient : num(0)
      ..@ hessian : num [1:5, 1:5] -4814 1846 362 -1200 -2266 ...
      ..@ itemtrace : num[0 , 0 ]
      ..@ lbound : num [1:5] -Inf -Inf -Inf -Inf -Inf
      ..@ ubound : num [1:5] Inf Inf Inf Inf Inf
      ..@ any.prior : logi FALSE
      ..@ prior.type : int [1:5] 0 0 0 0 0
      ..@ prior_1 : num [1:5] NaN NaN NaN NaN NaN
      ..@ prior_2 : num [1:5] NaN NaN NaN NaN NaN






      r






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 16 '18 at 18:46







      user2288107

















      asked Nov 16 '18 at 18:10









      user2288107user2288107

      295




      295
























          1 Answer
          1






          active

          oldest

          votes


















          1














          probtrace(extract.item(results.grm, 1), c(-1)) should work - also, might be helpful to look at https://github.com/philchalmers/mirt/issues/21






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343271%2fhow-to-get-value-of-fitted-curve-from-an-irt-model-at-specific-point-in-r%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            probtrace(extract.item(results.grm, 1), c(-1)) should work - also, might be helpful to look at https://github.com/philchalmers/mirt/issues/21






            share|improve this answer




























              1














              probtrace(extract.item(results.grm, 1), c(-1)) should work - also, might be helpful to look at https://github.com/philchalmers/mirt/issues/21






              share|improve this answer


























                1












                1








                1







                probtrace(extract.item(results.grm, 1), c(-1)) should work - also, might be helpful to look at https://github.com/philchalmers/mirt/issues/21






                share|improve this answer













                probtrace(extract.item(results.grm, 1), c(-1)) should work - also, might be helpful to look at https://github.com/philchalmers/mirt/issues/21







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 16 '18 at 21:22









                physicstravelsphysicstravels

                261




                261
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343271%2fhow-to-get-value-of-fitted-curve-from-an-irt-model-at-specific-point-in-r%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Florida Star v. B. J. F.

                    Danny Elfman

                    Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues