File:Datest Regression all on Tuberculosis.JPG

Original file(1,028 × 746 pixels, file size: 109 KB, MIME type: image/jpeg)


Summary

Description
English: This picture has been created with MD*Tech XploRe.


Graphical Elements

  • Plots of point clouds for all "dependent" variables (x-axis) on tuberculosis (y-axis)
    • all countries (colored crosses)
    • only cluster 1 (red small dots)
  • Variables colored according to all other graphics of en:Analysis of Tuberculosis (except: first plot, aids, usually red)
  • Linear and nonlinear regression lines (red, solid) according to hypothetical relation
  • Linear regression lines for cluster 1 (dashed, thin) according to hypothetical relation

Interpretation

Check en:Analysis of Tuberculosis.

Program Usage

If you want to display the point clouds and regression lines of different parts of the dataset in one plot, the code has to be slightly adjusted as exemplary done for three of the twelve elements of the graphic (little red dots, dashed lines).

Program Code

Attention! For repeating the computation a transformed dataset is needed! If you have not yet computated and saved the transformation, run the program for transformation on the wikipage en:Analysis of Tuberculosis first!


library("xplore")
library("stats")

; ----- Reading Data --------------------------------------------------------------------------

choose = "Read data from:"

defaults = "C:\Dokumente und Einstellungen\All Users\Desktop\UN_data_ordered.csv"

v1 = readvalue(choose, defaults)

x = readcsvm(v1)

x1 = readcsvm("C:\Dokumente und Einstellungen\All Users\Desktop\Cluster1.csv")
x1 = x1.double

data = x.double
country = x.text

; ----- 1.1) Nonlinear Regression of Aids on Tuberculosis --------------------------------------

ta = (0.8*log(data[,4]))~((data[,6]))

ta = paf(ta, isInf(ta[,1])==0)

{beta,bse,bstan,bpval} = linreg(ta[,1], ta[,2])

rx = #(0:max(data[,4]))

yq = beta[1] + beta[2]*log(rx)

rdata = sort (rx~yq)

rdata = setmask (rdata, "line", "red")

; ----- 4) Linear Regression of Sanitation on Tuberculosis -------------------------------------

gr4 = grlinreg(data[,8|6])

gr4 = setmask(gr4, "line", "red")

linreg(data[,8],data[,6])

; ----- 5) Linear Regression of Sanitation on Tuberculosis -------------------------------------

gr5 = grlinreg(data[,9|6])

gr5 = setmask(gr5, "line", "red")

linreg(data[,9],data[,6])

; ----- 5.1) Linear Regression (Cluster1) of Sanitation on Tuberculosis ------------------------

grcl5 = grlinreg(x1[,9|6])

grcl5 = setmask(grcl5, "line", "red", "size", "thin", "style", "dashed")

lr5cl1 = linreg(x1[,9],x1[,6])
lr5cl1

; ----- 6) Linear Regression of Sanitation on Tuberculosis -------------------------------------

gr6 = grlinreg(data[,10|6])

gr6 = setmask(gr6, "line", "red")

linreg(data[,10],data[,6])

; ----- 7) Linear Regression of Sanitation on Tuberculosis -------------------------------------

gr7 = grlinreg(data[,11|6])

gr7 = setmask(gr7, "line", "red")

linreg(data[,11],data[,6])

; ----- 8) Linear Regression of Sanitation on Tuberculosis -------------------------------------

gr8 = grlinreg(data[,12|6])

gr8 = setmask(gr8, "line", "red")

linreg(data[,12],data[,6])

; ----- 9) Linear Regression of 1/CO2^0.3 on Tuberculosis --------------------------------------

z9 = (data[,13]^(-0.3))~data[,6]

gr9 = grlinreg(z9)

gr9 = setmask(gr9, "line", "red")

; ----- 9.1) Nonlinear Regression --------------------------------------------------------------

{beta9,bse9,bstan9,bpval9} = linreg((data[,13]^(-0.3)), data[,6])

rx9 = #(0:max(data[,13])*100)/100

yq9 = beta9[1] + beta9[2]*rx9^(-0.3)

rdata9 = sort (rx9~yq9)

rdata9 = setmask (rdata9, "line", "red")

; ----- 10) Linear Regression of 1/Int^0.3 on Tuberculosis -------------------------------------

z10 = (data[,14]^(-0.3))~data[,6]

gr10 = grlinreg(z10)

gr10 = setmask(gr10, "line", "red")

; ----- 10.1) Nonlinear Regression -------------------------------------------------------------

{beta10,bse10,bstan10,bpval10} = linreg((data[,14]^(-0.3)), data[,6])

rx10 = #(0:max(data[,14])*1000)/1000

yq10 = beta10[1] + beta10[2]*rx10^(-0.3)

rdata10 = sort (rx10~yq10)

rdata10 = setmask (rdata10, "line", "red")

; ----- 10.2) Linear Regression (Cluster1) of Internet on Tuberculosis -------------------------

grcl10 = grlinreg(x1[,14|6])

grcl10 = setmask(grcl10, "line", "blue", "size", "thin", "style", "dashed")

lr10cl1 = linreg(x1[,14],x1[,6])
lr10cl1

; ----- 11) Linear Regression of 1/PC^0.3 on Tuberculosis --------------------------------------

z11 = (data[,15]^(-0.3))~data[,6]

gr11 = grlinreg(z11)

gr11 = setmask(gr11, "line", "red")

; ----- 11.1) Nonlinear Regression -------------------------------------------------------------

{beta11,bse11,bstan11,bpval11} = linreg((data[,15]^(-0.3)), data[,6])

rx11 = #(0:max(data[,15])*1000)/1000

yq11 = beta11[1] + beta11[2]*rx11^(-0.3)

rdata11 = sort (rx11~yq11)

rdata11 = setmask (rdata11, "line", "red")

; ----- 12) Linear Regression of 1/Tel^0.3 on Tuberculosis -------------------------------------

z12 = (data[,16]^(-0.3))~data[,6]

gr12 = grlinreg(z12)

gr12 = setmask(gr12, "line", "red")

; ----- 12.1) Nonlinear Regression -------------------------------------------------------------

{beta12,bse12,bstan12,bpval12} = linreg((data[,16]^(-0.3)), data[,6])

rx12 = #(0:max(data[,16])*300)/300

yq12 = beta12[1] + beta12[2]*rx12^(-0.3)

rdata12 = sort (rx12~yq12)

rdata12 = setmask (rdata12, "line", "red")

; ----- Create Colours -------------------------------------------------------------------------

randomize(25)
bunt = uniform(10, 3)*255
createcolor(bunt)

; ----- Graphical Settings ---------------------------------------------------------------------

setsize(800, 600)
f = createdisplay (3, 4)

; ----- Plotting the Point Clouds --------------------------------------------------------------

i = 4
j = 6

t1 = data[,i|j]
t2 = data[,i+1|j]
t3 = data[,i+3|j]
t4 = data[,i+4|j]
t5 = data[,i+5|j]
t6 = data[,i+6|j]
t7 = data[,i+7|j]
t8 = data[,i+8|j]
t9 = data[,i+9|j]
t10 = data[,i+10|j]
t11 = data[,i+11|j]
t12 = data[,i+12|j]

; ----- Example: Plotting the Cluster1 Point Cloud ---------------------------------------------

cl5 = x1[,i+5|j]
cl7 = x1[,i+7|j]
cl10 = x1[,i+10|j]

; ----- Graphical Settings ---------------------------------------------------------------------

setmaskp(t1, 0, 11)
setmaskp(t2, 5, 11)
setmaskp(t3, bunt[1], 11)
setmaskp(t4, bunt[2], 11)
setmaskp(t5, bunt[3], 11)
setmaskp(t6, bunt[4], 11)
setmaskp(t7, bunt[5], 11)
setmaskp(t8, bunt[6], 11)
setmaskp(t9, bunt[7], 11)
setmaskp(t10, bunt[8], 11)
setmaskp(t11, bunt[9], 11)
setmaskp(t12, bunt[10], 11)

setmaskp(cl5, 4, 1)
setmaskp(cl7, 4, 1)
setmaskp(cl10, 4, 1)

show(f, 1, 1, rdata, t1)
show(f, 1, 2, t2)
show(f, 1, 3, t3)
show(f, 1, 4, gr4, t4)

show(f, 2, 1, gr5, grcl5, t5, cl5)
show(f, 2, 2, gr6, t6)
show(f, 2, 3, gr7, t7, cl7)
show(f, 2, 4, gr8, t8)

setxaxis(f, 2, 1, min(min(data[,9:12])'), max(max(data[,9:12])'), 0)
setxaxis(f, 2, 2, min(min(data[,9:12])'), max(max(data[,9:12])'), 0)
setxaxis(f, 2, 3, min(min(data[,9:12])'), max(max(data[,9:12])'), 0)
setxaxis(f, 2, 4, min(min(data[,9:12])'), max(max(data[,9:12])'), 0)

show(f, 3, 1, rdata9, t9)
show(f, 3, 2, rdata10, grcl10, t10, cl10)
show(f, 3, 3, rdata11, t11)
show(f, 3, 4, rdata12, t12)

setyaxis(f, 3, 2, -25, 500)

Date 30 March 2007 (original upload date)
Source Transferred from en.wikibooks to Commons.
Author Schtiwi at English Wikibooks

Licensing

Schtiwi at the English Wikipedia, the copyright holder of this work, hereby publishes it under the following license:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
Attribution: Schtiwi at the English Wikipedia
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
This licensing tag was added to this file as part of the GFDL licensing update.

Original upload log

The original description page was here. All following user names refer to en.wikibooks.
Date/Time Dimensions User Comment
2007-03-30 11:55 1028×746× (111196 bytes) Schtiwi This picture has been created with MD*Tech XploRe.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

30 March 2007

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current14:19, 19 August 2017Thumbnail for version as of 14:19, 19 August 20171,028 × 746 (109 KB)JackPotte{{BotMoveToCommons|en.wikibooks|year={{subst:CURRENTYEAR}}|month={{subst:CURRENTMONTHNAME}}|day={{subst:CURRENTDAY}}}} == {{int:filedesc}} == {{Information |Description={{en|This picture has been created with MD*Tech XploRe. == Graphical Elements ==...

The following page uses this file: