anilbattalahalli / smartutils Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
Right now, it seems as if beta[2]
is providing the effect estimate of the the effect of A_2 given non-response rather than just the effect of A_2. If you run 1000 simulations, then the mean effect estimate of beta[2] = true beta[2]/(1 - r)
where r
denotes the probability of response. I can't seem to figure out why this is occurring. The other three coefficients seem to be correct.
Code:
I'm currently trying to specify a particular variable, y_adj
, as my outcome variable in cSMART.mm()
and I think there's something off with how the function handles the argument Y = "y_adj"
. I specify it as follows:
report <- cSMART.mm(Y ~ A1 + A2 + I(A1 * A2), df1, verbose = TRUE, covstr = 'IND', i = "school", Y = "y_adj")
but that provides the same output as when I use:
report <- cSMART.mm(Y ~ A1 + A2 + I(A1 * A2), df1, verbose = TRUE, covstr = 'IND', i = "school", Y = "Y")
(and note that it provides an error when I start with cSMART.mm(y_adj ~ ...
). When I instead recode y_adj
as simply Y
, I obtain different (and presumably, correct) output.
How an end-user should approach specifying the formula argument in the cSMART.mm function might need to be revisited.
if (R == 1) {
treat_code <- "-1,1,."
A2 <- 1
}
and
if (R == 1) {
treat_code <- "1,1,."
A2 <- 1
}
if (A1 == 1) {
R <- rbinom(1, 1, p_1)
if (R == 1) {
treat_code <- "1,1,."
A2 <- 1
} else if (R == 0) {
A2 <- (2 * rbinom(1, 1, p_A2)) - 1
treat_code <- sprintf("1,0,%d", A2)
}
} else if (A1 == -1) {
R <- rbinom(1, 1 , p_1)
if (R == 1) {
treat_code <- "-1,1,."
A2 <- 1
}
else if (R == 0) {
A2 <- (2 * rbinom(1, 1, p_A2)) - 1
treat_code <- sprintf("-1,0,%d", A2)
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.