Skip to content

Cannot run weighted CATE code. #6

@asamiahulin

Description

@asamiahulin

I tried to run the example code for this package and came across an error when I tried to run the weighted CATE estimator.

n = 4000; threshold = 0
X = sample(seq(-4, 4, by = 8/41.5), n, replace = TRUE)
W = as.numeric(X >= threshold)
Y = 0.4 * W + 1 / (1 + exp(2 * X)) + 0.2 * rnorm(n)

thresh.low = -1; thresh.high = 1
W = as.numeric(thresh.low <= X & X <= thresh.high)
Y = 0.2 * (1 + X) * W + 1 / (1 + exp(2 * X)) + rnorm(n)
out.4 = optrdd(X=X, Y=Y, W=W, max.second.derivative = 0.5)
print(out.4); plot(out.4, xlim = c(-2.5, 2.5))

This produced the following error:

Error in cbind.Matrix(x, y, deparse.level = 0L) :
cannot get a slot ("p") from an object of type "double"

This code seems to only work with older versions of the Matrix package, but not for newer versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions