Giter VIP home page Giter VIP logo

cjbart's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m Tom!
  • ๐ŸŒณ I am an Assistant Professor in the Department of Methodology at the London School of Economics
  • ๐ŸŒฑ Iโ€™m currently researching methodological issues surrounding deep learning models, experimental methods, causal inference, and missing data.
  • ๐Ÿ“ซ You can reach me at t.robinson7[at]lse.ac.uk

cjbart's People

Contributors

tsrobinson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cjbart's Issues

is it possible to estimate a non-binary cjoint outcome?

Is it possible to estimate a cjbart for a conjoint outcome for non-binary outcomes, e.g. continuous/likert scale?

Data setup:

 library(cjbart)
 subjects <- 250
 rounds <- 5
 profiles <- 2
 obs <- subjects*rounds*profiles

 fake_data <- data.frame(A = sample(c("a1","a2","a3"), obs, replace = TRUE),
                         B = sample(c("b1","b2","b3"), obs, replace = TRUE),
                         C = sample(c("c1","c2","c3"), obs, replace = TRUE),
                         D = sample(c("d1","d2","d3"), obs, replace = TRUE),
                         E = sample(c("e1","e2","e3"), obs, replace = TRUE),
                    
                         covar1 = rep(runif(subjects, 0 ,1),
                                      each = rounds),
                         covar2 = rep(sample(c(1,0),
                                             subjects,
                                             replace = TRUE),
                                      each = rounds),
                    
                         id1 = rep(1:subjects, each=rounds),
                         stringsAsFactors = TRUE)

in the example in ?cjbart this could be an outcome defined in the following way:

 fake_data$Y <- ifelse(fake_data$E == "e2",
                       rbinom(obs, 1, fake_data$covar1),
                       sample(c(1,2,3,4,5), obs, replace = TRUE))

Note that the outcome is an integer between 1 and 5 instead of a binary outcome of 0 or 1.

using this different outcome provides the following error when running:

 cj_model <- cjbart::cjbart(data = fake_data,
                            Y = "Y", 
                            id = "id1")
 het_effects <- cjbart::IMCE(data = fake_data, 
                             model = cj_model, 
                             attribs = c("A","B","C","D","E"),
                             ref_levels = c("a1","b1","c1","d1","e1"),
                             cores = 1)

 Calculating OMCEs for attribute: A [1/5]
 Error in quantile.default(var_z[, data[[id]] == s], intvl) : 
   missing values and NaN's not allowed if 'na.rm' is FALSE

I've noticed that if I rescale the five levels to values between 0 and 1, the algorithm works, e.g. using c(0, 0.25, 0.5, 0.75, 1) when sampling to generate Y the algorithm works. What does this imply for the estimation? Is this a valid approach for use with non-binary outcomes? It seems that the package was not designed for non-binary outcomes.

Restrict IMCE/OMCE calculations

When calling IMCE() all OMCEs are calculated, but it may be helpful to restrict these calculations to specific attribute(-levels).

Update vimp.R given randomForestSRC update

The extract.subsample() helper function has been modified in version 3.2.2. You will need to change
vimp_ci <- randomForestSRC::extract.subsample(randomForestSRC::subsample(rf_mod))$ci.jk.Z
to
vimp_ci <- randomForestSRC::extract.subsample(randomForestSRC::subsample(rf_mod, raw=TRUE))$ci.jk.Z

Documentation issues

The plot.cjbart.vimp method lists x as an object '...the result of running IMCE()', when in fact it should be the result of running het_vimp()

Vignette improvements

Revise opening para.
Change subset of facets shown in second plot to show e2 (where there is modelled heterogeneity).

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.