kosukeimai / CBPS

R package: CBPS
27 stars 10 forks source link

Call for HD-CBPS #17

Closed Chris-Aitken closed 6 years ago

Chris-Aitken commented 6 years ago

Hi there! Firstly, thank you for producing and maintaining this package! It's an excellent resource.

I'm currently conducting some research and would like to make use of your implementation of the HD-CBPS estimator. However, I'm having difficult with the function, and I suspect that it's just my interpretation of the documentation that is to blame. Could you please clarify the structure of the formula to be passed and the input type for the y argument?

For the latter, I get Error in which(coef(cov1) != 0) : argument to 'which' is not logical when I pass data directly, but when I simply reference the variable name (which is contained within the data.frame passed to data), it fails to recognise it (i.e., it returns object 'foo' not found).

psdsam commented 6 years ago

Hi Chris,

Thank you for your interest and using our package. This is a known issue and it is due to the R version we are using. A quick fix would be to change the 18 and 19 lines in the function hdCBPS.fit from

S1 = which(coef(cov1)!=0) S0 = which(coef(cov0)!=0)

to

S1 = which(as.logical(coef(cov1)!=0)) S0 = which(as.logical(coef(cov0)!=0))

We are working on improving the HD method and a new version will be updated in the next few weeks.

Please let me know if you have any question.

Best,

Sida

On Sun, Jul 8, 2018 at 12:03 PM, Chris-Aitken notifications@github.com wrote:

Hi there! Firstly, thank you for producing and maintaining this package! It's an excellent resource.

I'm currently conducting some research and would like to make use of your implementation of the HD-CBPS estimator. However, I'm having difficult with the function, and I suspect that it's just my interpretation of the documentation that is to blame. Could you please clarify the structure of the formula to be passed and the input type for the y argument?

For the latter, I get Error in which(coef(cov1) != 0) : argument to 'which' is not logical when I pass data directly, but when I simply reference the variable name (which is contained within the data.frame passed to data), it fails to recognise it (i.e., it returns object 'foo' not found).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kosukeimai/CBPS/issues/17, or mute the thread https://github.com/notifications/unsubscribe-auth/AMIIzjDfIpAqDYR5gQ6QfhjjR-NCKfD1ks5uEi1sgaJpZM4VGxtl .

Chris-Aitken commented 6 years ago

Hi Sida,

Thank you for responding so quickly! I modified hdCBPS.fit in line with your suggestions and rebuilt the package. It seems to be working perfectly now. Just to confirm, is the expected formula syntax treatment_var ~ x_1 + x_2 + ... + x_d, as in the CBPS LaLonde-based example?

Best,

Chris

psdsam commented 6 years ago

Hi Chris,

Yes, the syntax is the same as standard CBPS package as you wrote down.

Best,

Sida

On Sun, Jul 8, 2018 at 2:59 PM, Chris-Aitken notifications@github.com wrote:

Hi Sida,

Thank you for responding so quickly! I modified hdCBPS.fit in line with your suggestions and rebuilt the package. It seems to be working perfectly now. Just to confirm, is the expected formula syntax treatment_var ~ x_1

  • x_2 + ... + x_d, as in the CBPS LaLonde-based example?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kosukeimai/CBPS/issues/17#issuecomment-403308867, or mute the thread https://github.com/notifications/unsubscribe-auth/AMIIzsqFzymPswi75Hl6UZxuIfcE4uN4ks5uElaQgaJpZM4VGxtl .

kosukeimai commented 6 years ago

@psdsam Can you go ahead and make the change to the code?

psdsam commented 6 years ago

Yang and I are working on a modified method. We can update those all at once? Or I can do a quick pull request and fix this first?

Let me know which one you prefer?

Thank you,

Best,

Sida

On Sun, Jul 8, 2018 at 4:10 PM, Kosuke Imai notifications@github.com wrote:

@psdsam https://github.com/psdsam Can you go ahead and make the change to the code?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kosukeimai/CBPS/issues/17#issuecomment-403313439, or mute the thread https://github.com/notifications/unsubscribe-auth/AMIIzkfF7m0poTR9n-EEK13Pb5077MB_ks5uEmc-gaJpZM4VGxtl .

kosukeimai commented 6 years ago

I think you can do a quick fix so that the problem does not occur again for the mean time.

psdsam commented 6 years ago

just did the change

On Sun, Jul 8, 2018 at 4:37 PM, Kosuke Imai notifications@github.com wrote:

I think you can do a quick fix so that the problem does not occur again for the mean time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kosukeimai/CBPS/issues/17#issuecomment-403315144, or mute the thread https://github.com/notifications/unsubscribe-auth/AMIIztq6Yvxlt3WPeN1WtmIKe6vwIZ44ks5uEm11gaJpZM4VGxtl .