Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error, argument "bins" is missing. #82

Open
MalloryJfeldman opened this issue Feb 2, 2024 · 3 comments
Open

Error, argument "bins" is missing. #82

MalloryJfeldman opened this issue Feb 2, 2024 · 3 comments

Comments

@MalloryJfeldman
Copy link
Contributor

I've been trying to run this code to analyze cardioception data in R! However, my code keeps getting stuck trying to run single subject analysis. After looking through the code, it doesn't look like "bins" are ever defined in the get_AUC helper function.

Here's the specific error:

"Error in get_AUROC(df, unique(df$Modality)) :
argument "bins" is missing, with no default"

@MalloryJfeldman
Copy link
Contributor Author

Hey @JesperFischer I've realized that this error only pops up when running subject that only completed the intero condition (and not the extero condition). This is even when I put "NA" in the arguments for the numpy array for the extero. Any suggestions?

@jamie-moffatt
Copy link

I had the same error when analysing data with only the interoceptive modality. The bins argument appears to be missing on the get_AUROC call in the helpers.R script at line 847. If you change it to the following code it runs past this error:

int = get_AUROC(df, unique(df$Modality), bins)

However, the script now throws a new error which appears to be related to the flemmings function:

Error in data.frame(..., check.names = FALSE) :
object 'flem_AUC_E' not found

If you set the argument flem to FALSE on lines 142 and 143 of the firstlevelanalysis.R script, the analysis runs without an error:

  AUC_plot = get_AUC(df1,bins = T,flem = F)$plot
  resultsdata = cbind(resultsdata, get_AUC(df1,bins = T, flem = F)$data)

This allowed me to use the script to extract the outcome values. Hopefully this helps to pinpoint where the error is appearing from - it seems to be something to do with how the scripts handle the AUC plots if there is only one modality.

@JesperFischer
Copy link
Collaborator

Hi @MalloryJfeldman

Firstly, sorry for the very late response, hopefully you've had luck with @jamie-moffatt solution, which circumvents the problem. The only problem with this solution is that it uses an alternative way to calculating the AUC. This method is similar but not identical to the standard method.

I've pushed the fixes to the scripts and they should work, also with subjects that have only completed the Intero condition. Let me know if there are any more troubles and I'll be happy to help.

Additional I've added some extra scripts and explanations to the post-hoc Bayesian fits, which allows you to model the psychometric function with a lapse rate, which can greatly increase the estimation of the slope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants