metacran / metacranweb

Web pages for metacran
http://www.r-pkg.org
13 stars 6 forks source link

object 'y_name' not found even when 'y_name' is in model #126

Closed ericycchan closed 4 months ago

ericycchan commented 4 months ago

Here is the output of model:

model
<HDCATE>
  Public:
    alpha: NA
    ate: NA
    bw: rule-of-thumb
    clone: function (deep = FALSE) 
    cond_interval: -1 0 1 2 3 4
    cond_var_eval_step: 1
    cond_var_lower: -1
    cond_var_name: diverse_code
    cond_var_upper: 4
    conditional_expectations_hd_estimate: function (data = NA, verbose = F) 
    d: 1
    d_name: treatment
    data: data.frame
    draw_weights: function (method, n_rep_boot, n_obs) 
    eta_hat_func_list: NA
    eta_hat_list: NA
    expectation_est_method: lasso
    first_stage: function (data = NA, verbose = F) 
    fit: function (verbose = FALSE) 
    folds: list
    get_bw: function (phi, use_sample_idx) 
    get_confidence_bands: function (test_side = "both") 
    h: NA
    hdcate: NA
    i_left_side: NA
    i_right_side: NA
    i_two_side: NA
    inference: function (sig_level = 0.01, boot_method = "normal", n_rep_boot = 1000, 
    initialize: function (data, y_name, d_name, x_formula) 
    k_fold: 5
    length_grid: 6
    local_reg_model_list: list
    local_weight: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1  ...
    n_alpha: NA
    n_obs: 73865
    plot: function (output_pdf = FALSE, pdf_name = "hdcate_plot.pdf", include_band = TRUE, 
    propensity_est_method: lasso
    propensity_hd_estimate: function (data = NA, verbose = F) 
    propensity_score_model_list: list
    second_stage: function (predictor_eta_hat = NA, eta_hat = NA, subsample_idx = NULL, 
    set_condition_var: function (name = NA, min = NA, max = NA, step = NA) 
    sigma_hat: NA
    treated_cond_exp_model_list: list
    untreated_cond_exp_model_list: list
    use_cross_fitting: TRUE
    user_defined_first_stage: FALSE
    user_defined_fit_ps: NA
    user_defined_fit_treated: NA
    user_defined_fit_untreated: NA
    user_defined_predict_ps: NA
    user_defined_predict_treated: NA
    user_defined_predict_untreated: NA
    vate: NA
    x_formula: sex_male + indicator_smi + indicator_sud + 
                 ...
    y_name: n_er_iph
  Private:
    check_data: function (data) 

When I tried to fit the model, the propensity score estimation and expectation values estimation were completed successfully, then it complains that y_name is not found. If y_name was not found, how could it do the two step estimations? And it's in the model any way. `` HDCATE.set_condition_var(model, 'diverse_code', min=-1, max=4, step=1) Updated conditional variable to: name=diverse_code, min=-1, max=4, step=1. HDCATE.fit(model) Use full-sample estimator. Start estimating model for propensity score, method=lasso Finish estimating propensity score. Start estimating conditional expectations, method=lasso Finish estimating conditional expectations. Start estimating HDCATE. Error in eval(object$call$formula) : object 'y_name' not found



packageVersion("hdcate")
[1] ‘0.1.0’
gaborcsardi commented 4 months ago

This repository is for the r-pkg.org web site. I suggest you contact the package author.

ericycchan commented 4 months ago

Hi Gábor,

Thank you for your response and suggestions that I should contact the package author. That's exactly what I want to do, but I do not have the email address or url to some git hub for doing that. Would you be able to ask the author to contact me? I am working as a data scientist in a company called LA Care in Los Angeles. I would appreciate if you can help me contact the author.

Thanks, Eric @.***


From: Gábor Csárdi @.> Sent: Thursday, April 18, 2024 12:55 PM To: metacran/metacranweb @.> Cc: ericycchan @.>; Author @.> Subject: Re: [metacran/metacranweb] object 'y_name' not found even when 'y_name' is in model (Issue #126)

This repository is for the r-pkg.org web site. I suggest you contact the package author.

— Reply to this email directly, view it on GitHubhttps://github.com/metacran/metacranweb/issues/126#issuecomment-2065151167, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALYEFSH2GUPFDYABNVPXMGDY6AQLTAVCNFSM6AAAAABGN5PMNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRVGE2TCMJWG4. You are receiving this because you authored the thread.

gaborcsardi commented 4 months ago

Click on the name of the maintainer at https://r-pkg.org/pkg/hdcate or see https://cran.rstudio.com/web/packages/hdcate/ or

❯ packageDescription("hdcate")$Maintainer
[1] "Qingliang Fan <michaelqfan@cuhk.edu.hk>"