Tipping point from imputed DATA from R to MATLAB

1 visualización (últimos 30 días)
Raisul Islam
Raisul Islam el 8 de Nov. de 2017
Hi, I have a R code and SAS code for tipping point analysis. Please help me to do this analysis in MATLAB. https://cran.r-project.org/web/packages/TippingPoint/vignettes/TippingPoint.html Attached is SAS code and the link is from R. I am giving the R code in steps in the following. From imputed DATA # Load the imputed dataset
data(imputedata)
  1. Show the first 6 rows of the data
head(imputedata)
## MAR_T1 MAR_C1 MAR_T2 MAR_C2 MCAR_T1 MCAR_C1 MCAR_T2 MCAR_C2
## 1 118.1192 122.8743 7 14 128.4723 129.7369 6 13
## 2 129.7815 124.6130 5 19 130.1233 126.1398 6 11
## 3 124.3407 122.6200 5 17 124.9609 128.7701 5 14
## 4 126.6131 126.6311 4 15 126.9734 126.3991 4 10
## 5 127.8940 126.4212 8 16 125.9800 130.9947 5 10
## 6 122.1164 121.5700 4 13 127.0293 128.4050 5 13 ## for binary outcome
TippingPoint(outcome=tippingdata$binary,
treat= tippingdata$treat, group.infor=TRUE,
plot.type = "estimate",ind.values = TRUE,
impValuesT = imputedata[,c("MAR_T2","MCAR_T2")],
impValuesC = imputedata[,c("MAR_C2","MCAR_C2")],
summary.type = "density", alpha = 0.95, S=1.5, n.grid = 100,
HistMeanT = c(0.38,0.4), HistMeanC = c(0.2,0.55))
  1. User-defined colorsTippingPoint(outcome=tippingdata$binary,treat= tippingdata$treat,
plot.type = "p.value",ind.values = TRUE,
impValuesT = imputedata[,c("MAR_T2","MCAR_T2")],
impValuesC = imputedata[,c("MAR_C2","MCAR_C2")],
impValuesColor = RColorBrewer::brewer.pal(8,"Accent")[5:6],
summary.type = "credible.region", alpha = 0.95, S=1.5, n.grid = 100,
HistMeanT = c(0.38,0.4), HistMeanC = c(0.2,0.55))
  1. Using `point.size` and `point.shape` to control the points.TippingPoint(outcome=tippingdata$binary,treat= tippingdata$treat,
plot.type = "both",ind.values = TRUE,
impValuesT = imputedata[,c("MAR_T2","MCAR_T2")],
impValuesC = imputedata[,c("MAR_C2","MCAR_C2")],
impValuesColor =c("red","blue"),
point.size=0.8,point.shape = 15,
summary.type = "convex.hull", alpha = 0.95, S=1.5, n.grid = 100,
HistMeanT = c(0.38,0.4), HistMeanC = c(0.2,0.55))
## for continuous outcome
TippingPoint(outcome=tippingdata$continuous,
treat= tippingdata$treat, group.infor=TRUE,
plot.type = "p.value",ind.values = TRUE,
impValuesT = imputedata[,c("MAR_T1","MCAR_T1")],
impValuesC = imputedata[,c("MAR_C1","MCAR_C1")],
summary.type = "density", alpha = 0.95, S=1.5, n.grid = 100,
HistMeanT = c(120), HistMeanC = c(131,137))
  1. Using `point.size` and `point.shape` to control the points.TippingPoint(outcome=tippingdata$continuous,treat= tippingdata$treat,
plot.type = "p.value",ind.values = TRUE,
impValuesT = imputedata[,c("MAR_T1","MCAR_T1")],
impValuesC = imputedata[,c("MAR_C1","MCAR_C1")],
point.size = 0.8, point.shape = 15,
summary.type = "credible.region", alpha = 0.95, S=1.5, n.grid = 100,
HistMeanT = c(120), HistMeanC = c(131,137))
TippingPoint(outcome=tippingdata$continuous,treat= tippingdata$treat,
plot.type = "both",ind.values = TRUE,
impValuesT = imputedata[,c("MAR_T1","MCAR_T1")],
impValuesC = imputedata[,c("MAR_C1","MCAR_C1")],
summary.type = "convex.hull", alpha = 0.95, S=1.5, n.grid = 100,
HistMeanT = c(120), HistMeanC = c(131,137))
See if you can transform this to MATLAB code?

Respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by