dexter-psychometrics / dexter

Management, assessment, and psychometric analysis of data from educational and psychological tests
GNU Lesser General Public License v3.0
8 stars 5 forks source link

Error trying to equate #11

Open frankbach opened 8 months ago

frankbach commented 8 months ago

I have tried to exclude missing values when equating as follows

p_sm <- fit_enorm(gbpnas, response != -99, method = "CML")
ref_items <- get_design(gbpnas) |> 
    filter(booklet_id == "h22") |> select(item_id) |> as_vector()
target_booklet <- tibble(booklet_id="h23", item_id = get_design(gbpnas) |> 
                           select(item_id) |> as_vector())
ou_e <- probability_to_pass(gbpnas, p_sm,
    ref_items = ref_items,
    target_booklets = target_booklet,
    pass_fail = 124)

But when I run the last part above R crashes and I have to restart. Any suggestions?

Best regards Frank

jessekps commented 8 months ago

No, that is a bug. Which version of dexter are you using? And is there any chance you could share this dataset? If the dataset is confidential, then the output of design_info(gbpnas, response != -99)$design would also be helpful (that would contain booklet id's, item id's, the design and number of persons per booklet but no responses or other identifying information). You can email it to jesse.koops at cito.nl.

And, if possible, also the output of coef(p_sm), which would contain item parameters but no identifying information.

jessekps commented 7 months ago

Hi Frank,

I could not replicate the problem nor find any points in the code that could conceivably crash an R session. Nevertheless, I updated the function so I'm curious if the problem persists before I delve deeper.

Could you try installing the development version and try your code again?

remotes::install_github("dexter-psychometrics/dexter")

frankbach commented 7 months ago

Thanks for your efforts!

I will install the GitHub version and try again

Frank

24 nov. 2023 kl. 13:37 skrev Jesse Koops @.***>:

Hi Frank,

I could not replicate the problem nor find any points in the code that could conceivably crash an R session. Nevertheless, I updated the function so I'm curious if the problem persists before I delve deeper.

Could you try installing the development version and try your code again?

remotes::install_github("dexter-psychometrics/dexter")

— Reply to this email directly, view it on GitHubhttps://github.com/dexter-psychometrics/dexter/issues/11#issuecomment-1825617821, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHGKE2KCKEZHPIHLYNBS3XLYGCIHDAVCNFSM6AAAAAA7VW3M4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRVGYYTOOBSGE. You are receiving this because you authored the thread.Message ID: @.***>

jessekps commented 7 months ago

Ah, I guess you're on a Mac. Installation from source is tricky on a Mac. I'll have to think about it.

jessekps commented 7 months ago

If you're on a Mac, you can try to follow the instructions here: https://github.com/dexter-psychometrics/dexterMML/blob/master/dexterMML%20setup%20on%20macOS.md

And then, in the final part instead of where it says "Install dexterMML" you can run: remotes::install_github("dexter-psychometrics/dexter", dependencies=TRUE)

I don't know how difficult it will be since I don't have access to a Mac.

frankbach commented 7 months ago

I have tried to follow the instruction, but I got the following message.

elsym.cpp:3:10: fatal error: 'omp.h' file not found

include

     ^~~~~~~

1 error generated. make: *** [elsym.o] Error 1 ERROR: compilation failed for package ‘dexter’

One thing was not clear to me, where to put the .R/Makevars. I have tried a couple of different locations, but none of them worked.

Best,

Frank

24 nov. 2023 kl. 15:01 skrev Jesse Koops @.***>:

If you're on a Mac, you can try to follow the instructions here: https://github.com/dexter-psychometrics/dexterMML/blob/master/dexterMML%20setup%20on%20macOS.md

And then, in the final part instead of where it says "Install dexterMML" you can run: remotes::install_github("dexter-psychometrics/dexter")

I don't know how difficult it will be since I don't have access to a Mac.

— Reply to this email directly, view it on GitHubhttps://github.com/dexter-psychometrics/dexter/issues/11#issuecomment-1825717936, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHGKE2L4MHCAVXYRFRAP6VTYGCSCBAVCNFSM6AAAAAA7VW3M4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRVG4YTOOJTGY. You are receiving this because you authored the thread.Message ID: @.***>

jessekps commented 7 months ago

Well, in theory the makeVars should be placed here: file.path(normalizePath('~'),'.R'), but that might not be the issue, R on a mac is tricky. I'll try to borrow a mac from someone in the office. This may take some time.

frankbach commented 7 months ago

Thanks for your efforts!

Frank

28 nov. 2023 kl. 08:20 skrev Jesse Koops @.***>:

Well, in theory the makeVars should be placed here: file.path(normalizePath('~'),'.R'), but that might not be the issue, R on a mac is tricky. I'll try to borrow a mac from someone in the office. This may take some time.

— Reply to this email directly, view it on GitHubhttps://github.com/dexter-psychometrics/dexter/issues/11#issuecomment-1829244929, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHGKE2PWO432OSTAR6I7X4TYGWGE5AVCNFSM6AAAAAA7VW3M4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRZGI2DIOJSHE. You are receiving this because you authored the thread.Message ID: @.***>

jessekps commented 7 months ago

I've pushed a new version to github which should be installable on a mac by just using remotes::install_github("dexter-psychometrics/dexter"). And then I'd be curious if your original problem still persists.

jessekps commented 6 months ago

Hi Frank, there is a new version of dexter on cran. Could you check if the problem persists in the new version?

frankbach commented 6 months ago

Thanx! Hi Jesse! When I try to exclude the missing responses, it takes a very long time (an hour or more) and the the size of the object shrinks from 52 MB to around 4 MB. I suspect that all responses on items where there are missing responses are removed. What would be a correct code to exlude missing responses from the data set when performing fit_enorm()?

jessekps commented 6 months ago

Assuming your missing_responses are coded -99, this would be correct.

p_sm <- fit_enorm(gbpnas, response != -99, method = "CML")

Usually for educational tests missing responses are just scored 0 and in the item calibration persons with a too high percentage missing are removed or only 'not reached' responses are removed; then the code would be a little different.

An hour is very long, CML usually takes seconds. However, CML is a test form/booklet based method. If the number of missing responses is large it could become slow if you essentially create a separate booklet per person (since almost none of the persons would have the exact same missing pattern, each person would get a unique test form). You could check this by running:

dsg = design_info(gbpnas, response != -99)

n_distinct(dsg$design$booklet_id)

1000's of booklets might be problematic, especially on a mac where the computations are not done in parallel. Such a dataset without a booklet design is not well suited for CML and you might switch to an MML package.