Thank you!
-
Login or Register
- Log in with
* Example generated by -dataex-. For more info, type help dataex
clear
input float(treatment north mean_v1 mean_v2 mean_v3 mean_v4 yu_v1 yu_v2 yu_v3 yu_v4 yl_v1 yl_v2 yl_v3 yl_v4)
0 0 12.92 4.38 12.92 4.38 15.19 5.21 15.19 5.21 10.61 3.5 10.61 3.5
0 1 8.05 3.07 8.05 3.07 10.59 4.15 10.59 4.15 5.47 1.99 5.47 1.99
1 0 13.4 5.42 13.4 5.42 17.96 6.76 17.96 6.76 10.82 4.08 10.82 4.08
1 1 8.11 2.99 8.11 2.99 12.54 3.68 12.54 3.68 5.62 2.32 5.62 2.32
end
gen id=_n
reshape long mean_ yu_ yl_, i(id) j(which) string
destring which, ignore(v) replace
cap noisily{
mkmat which-yl if north & !treatment, mat(coefs10) rowname(which)
mkmat which-yl if north & treatment, mat(coefs11) rowname(which)
mkmat which-yl if !north & !treatment, mat(coefs00) rowname(which)
mkmat which-yl if !north & treatment, mat(coefs01) rowname(which)
}
coefplot (mat(coefs10[,4]), ci((coefs10[,6] coefs10[,5])) msy(Oh)) ///
(mat(coefs11[,4]), ci((coefs11[,6] coefs11[,5])) msy(Th)), offset(0) bylabel(North) || ///
(mat(coefs00[,4]), ci((coefs00[,6] coefs00[,5]))) ///
(mat(coefs01[,4]), ci((coefs01[,6] coefs01[,5]))), offset(0) bylabel(South) ||, ///
leg(order(2 "Control" 4 "Treatment")) byopts(note(Dashed line represents true values)) ///
ciopts(recast(rcap)) ylab(1 "Var 1" 2 "Var 2" 4 "Var 3" 5 "Var 4") ///
groups(var 1 var 2= "{bf:Label A}" var 3 var 4 = "{bf:Label B}", angle(vert))
* Example generated by -dataex-. For more info, type help dataex clear input float(treatment north mean_v1 mean_v2 mean_v3 mean_v4 yu_v1 yu_v2 yu_v3 yu_v4 yl_v1 yl_v2 yl_v3 yl_v4) 0 0 12.92 4.38 12.92 4.38 15.19 5.21 15.19 5.21 10.61 3.5 10.61 3.5 0 1 8.05 3.07 8.05 3.07 10.59 4.15 10.59 4.15 5.47 1.99 5.47 1.99 1 0 13.4 5.42 13.4 5.42 17.96 6.76 17.96 6.76 10.82 4.08 10.82 4.08 1 1 8.11 2.99 8.11 2.99 12.54 3.68 12.54 3.68 5.62 2.32 5.62 2.32 end gen id=_n reshape long mean_ yu_ yl_, i(id) j(which) string destring which, ignore(v) replace cap noisily{ mkmat which-yl if north & !treatment, mat(coefs10) rowname(which) mkmat which-yl if north & treatment, mat(coefs11) rowname(which) mkmat which-yl if !north & !treatment, mat(coefs00) rowname(which) mkmat which-yl if !north & treatment, mat(coefs01) rowname(which) } coefplot (mat(coefs10[,4]), ci((coefs10[,6] coefs10[,5])) msy(Oh)) /// (mat(coefs11[,4]), ci((coefs11[,6] coefs11[,5])) msy(Th)), offset(0) bylabel(North) || /// (mat(coefs00[,4]), ci((coefs00[,6] coefs00[,5]))) /// (mat(coefs01[,4]), ci((coefs01[,6] coefs01[,5]))), offset(0) bylabel(South) ||, /// leg(order(2 "Control" 4 "Treatment")) byopts(note(Dashed line represents true values)) /// ciopts(recast(rcap)) ylab(2 "Var 1" 3 "Var 2" 6 "Var 3" 7 "Var 4") /// headings(var 1 = "{bf:Label A}" var 3 = "{bf:Label B}")
* Example generated by -dataex-. For more info, type help dataex clear input float(treatment north mean_v1 mean_v2 mean_v3 mean_v4 yu_v1 yu_v2 yu_v3 yu_v4 yl_v1 yl_v2 yl_v3 yl_v4) 0 0 12.92 4.38 12.92 4.38 15.19 5.21 15.19 5.21 10.61 3.5 10.61 3.5 0 1 8.05 3.07 8.05 3.07 10.59 4.15 10.59 4.15 5.47 1.99 5.47 1.99 1 0 13.4 5.42 13.4 5.42 17.96 6.76 17.96 6.76 10.82 4.08 10.82 4.08 1 1 8.11 2.99 8.11 2.99 12.54 3.68 12.54 3.68 5.62 2.32 5.62 2.32 end gen id=_n reshape long mean_ yu_ yl_, i(id) j(which) string destring which, ignore(v) replace cap noisily{ mkmat which-yl if north & !treatment, mat(coefs10) rowname(which) mkmat which-yl if north & treatment, mat(coefs11) rowname(which) mkmat which-yl if !north & !treatment, mat(coefs00) rowname(which) mkmat which-yl if !north & treatment, mat(coefs01) rowname(which) } coefplot (mat(coefs10[,4]), ci((coefs10[,6] coefs10[,5])) msy(Oh)) /// (mat(coefs11[,4]), ci((coefs11[,6] coefs11[,5])) msy(Th)), offset(0) bylabel(North) || /// (mat(coefs00[,4]), ci((coefs00[,6] coefs00[,5]))) /// (mat(coefs01[,4]), ci((coefs01[,6] coefs01[,5]))), offset(0) bylabel(South) ||, /// leg(order(2 "Control" 4 "Treatment")) byopts(note(Dashed line represents true values)) /// ciopts(recast(rcap)) coeflab(1 = "Var 1" 2 = "Var 2" 3 = "Var 3" 4 = "Var 4") /// headings(var 1 = "Label A" var 3 = "Label B")
Comment