Giter VIP home page Giter VIP logo

suddengains's People

Contributors

grahamthew avatar hadley avatar milanwiedemann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hadley

suddengains's Issues

add option to change critical value used for 3rd sg crit

could use base::abs(stats::qt((0.05 / 2), 4)) or something similar to change alpha, e.g.:

#' @param sg_crit3_qtp Numeric, significance level of the two-tailed student t-test to determine the critical value to be used for the third criterion.
#' Degrees of freedom are based on the number of available data in the three sessions preceding the gain and the three sessions following the gain.

Add option to set individual cut offs for each participant

As raised by a reviewer, it might be of interest to set individual cut offs for each participant. This would be similar to the modification of the third criterion used by Kelly et al 2005 and 2007 to assess stability.

This could be implemented in the R package as a modification of the first or third criterion. Computationally this approach is similar to the way the first criterion gets assessed.
Conceptually the way individual cut off scores are calculated would is closer to third criterion (stability). There could also be other useful applications of individual cut off scores calculated in a different way to Kelly et al.

Kelly, M. A. R., Cyranowski, J. M., & Frank, E. (2007). Sudden gains in interpersonal psychotherapy for depression. Behaviour Research and Therapy, 45(11), 2563–2572. https://doi.org/10.1016/j.brat.2007.07.007

Kelly, M. A. R., Roberts, J. E., & Ciesla, J. A. (2005). Sudden gains in cognitive behavioral treatment for depression: When do they occur and do they matter? Behaviour Research and Therapy, 43(6), 703–714. https://doi.org/10.1016/j.brat.2004.06.002

plot_sg() function requires sg_crit123 to be true (1) for all patients to show start and end of treatment

when using the plot_sg() function to visualise changes of scores around a sudden gain for two groups both groups need to have:

sg_crit123 = 1

when using the function to plot changes for one group that did have a sudden gain and another group that didnt have a sudden gain, this currently needs to be changed manually but overwriting sg_crit123 = 1 for all participants. the information about which group participants belong to (e.g., "group_variable") need to be stored in another variable and used in the group_var_name argument.

add option to NOT use 3rd criterion

this is already possible for the first sg_crit1_cutoff = 0 and second criterion sg_crit2_cutoff = 0 but not for the third criterion. in code this could look like this: sg_crit3_cutoff = NULL. to unify the code NULL could also be added to the sg_crit2_cutoff and sg_crit2_cutoff arguments.

add option to modify 3rd sudden gains criterion

for example only one pre or post gain score needs to be available. there would be different options to think about adding this, for example:

  • to only integrate this this only for the first and last between session interval to identify very early and very late gains/losses
  • add this function for every between session interval?

add test_sg() function

set sg criteria in function, enter 3 pregain and 3 postgain values as voctor list or input (maybe also base::readline ...), this would also work great as shiny app

add checks for missings and duplicates in id variable

I was thinking of something like this, get vector of all ids and then sum the duplicates and missings, this can then be checked and used for error msg

ids <- sgdata$id
sum_id_duplicates <- base::sum(base::duplicated(stats::na.omit(ids)))
sum_id_missings <- base::sum(base::is.na(ids))

plot_sg() function has wrong start and end means and sds

for bysg datasets need to filter for unique IDs so that start values of cases with multiple gains only get selected once and not as often as that case had a sg/sl.

for byperson need to filter for sg/sl cases only so that not whole sample gets included in calculations for start and end value

Implement different approaches to calculate the standard deviation for criterion 3

As raised during peer review, consider implementing different approaches to calculate the standard deviation for criterion 3. The method currently implemented in the package represents an independent sample t test.

  • Consider the option to incorporate the correlation between the pre and post gain measures into this formula following Cohen (1988).
  • Also consider the option to use only the standard deviation of the pre gain scores given that the standard deviation is maybe expected to change across the intervention Glass and colleagues (1981)

Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences. New York, NY: Routledge Academic.
Glass, G. V., McGaw, B., and Smith, M. L. (1981). Meta-Analysis in Social Research. Beverly Hills, CA: Sage.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.