This is a file from the Wikimedia Commons

File:Datest Nonlinear Regression Tuberculosis vs Aids.JPG

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Datest_Nonlinear_Regression_Tuberculosis_vs_Aids.JPG(800 × 600 pixels, file size: 60 KB, MIME type: image/jpeg)


Summary

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


Upper Graphic

This chart is generated by transforming the axes of the coordinate system according to a hypothetical relation between the variables. The functional form used here, is based on the assumption of exponentially increasing numbers of aids related deaths if tuberculosis prevalence is high. Although, both variables are mutually related, medical scientists would probably argue, that aids related deaths are influenced by tuberculosis prevalence rather than the other way around. So, just rotate the chart if that makes you feel more comfortable.

Lower Graphic

This plot shows a nonlinear regression line, which has been calculated by using the upper setting.

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)

data = x.double
country = x.text

; ----- Linear Regression of 0.8*log(Aids) on Tuberculosis ------------------------------------

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

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

nlreg = grlinreg(ta)

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

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

{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")

; ----- Results of Aids vs. Tuberculosis ------------------------------------------------------

setsize(800, 600)
d1 = createdisplay (2, 1)

; ----- Mark potentiell outliers --------------------------------------------------------------

text = country[data[24|43|70|65|9|33,1]]
tp = data[24|43|70|65|9|33,4|6]
tp2 = 0.8*log(data[24|43|70|65|9|33,4])~data[24|43|70|65|9|33,6]

setmaskt(tp, text, (1|2|3|4|5|6), (6|12|3|3|6|3))
setmaskt(tp2, text, (1|2|3|4|5|6), (6|12|3|3|6|3))
setmaskp(tp, (1|2|3|4|5|6))
setmaskp(tp2, (1|2|3|4|5|6))

; ----- Graphical Options ---------------------------------------------------------------------

show(d1, 1, 1, nlreg, ta, tp2)
show(d1, 2, 1, rdata, data[,4|6], tp)

title1 = "Linear Regression of Transformed Variables"
xaxis1 = "0.8 * log('Aids est. Death')"
yaxis1 = "Tuberculosis Prevelance per 100.000"
setgopt(d1, 1, 1, "title", title1, "ylabel", yaxis1, "xlabel", xaxis1)

title2 = "Equivalent Nonlinear Regression Line According to Hypothetical Relation"
xaxis2 = "Aids Estimated Death per 100.000"
yaxis2 = "Tuberculosis Prevelance per 100.000"
setgopt(d1, 2, 1, "title", title2, "ylabel", yaxis2, "xlabel", xaxis2)

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:52 800×600× (61705 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 2017800 × 600 (60 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. == Upper Graphic == This...

The following page uses this file: