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

External vector of GPS #42

Open
athammad opened this issue Nov 26, 2021 · 4 comments
Open

External vector of GPS #42

athammad opened this issue Nov 26, 2021 · 4 comments

Comments

@athammad
Copy link

Hi guys,

It seems to me that the GPS is calculated internally. What if I have a vector with the GPS (calculated using my own code) and I would like to "plug it" into the model to estimate the DRF?

Thank you very much.

@ronikobrosly
Copy link
Owner

ronikobrosly commented Nov 26, 2021

Hi @athammad ! You are correct, it is calculated internally, but I believe you should be able to substitute in your estimates of GPS values here:

self.gps_at_grid = self._gps_values_at_grid()

That is, after you run the ‘fit’ function you can do something like this

‘gps.gps_at_grid = [your array of your own GPS values at the treatment grid points]’

… and then you can calculate the CDRC as usual. Does that make sense?

@athammad
Copy link
Author

HI @ronikobrosly! Thank you for getting back to me. What do you mean by "GPS values at the treatment grid points"? I have a vector with the calculated GPS for every observation in my Dataframe. Are you suggesting that I should recalculate the GPS with a multinomial regression after creating a quantile-based grid across the values of the treatment equivalent to the one I would have to select in GPS_Regressor(treatment_grid_num = 100)?

Best wishes

@ronikobrosly
Copy link
Owner

Thinking about this a bit more, I think there is a simpler approach here that will save you time @athammad . If you already have an estimate of the GPS for each observation, then you really dont even need this package: you can estimate the CDRC directly using the treatment values, GPS values, and outcome values. See the methods section of this paper for more details: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5969262/

Specifically the section “ 2.3. Estimation of the dose‐response function using the GPS”.

@ronikobrosly
Copy link
Owner

Probably easier than adapting the package to fit your GPS, if that makes sense

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

2 participants