Final Project-R Package


Introduction 

BMI/BP Calculator

My biological father suffered a stroke 4 years ago , however, I am not here to lament on his medical condition but to provide a solution, to be more precise, a preventative measure for physical trainers ( which I believe play a important role in professional spheres) or any for that matter. This tool can help someone quickly figure out the next best course of actions regarding there medical health, and body weight, if there are any concerns to report. The calculator output the value of your cardiac output, which is the volumetric flow rate, Q. The optimum value is 40 L/m. Recording this value we can calculate Mean Arterial Pressure (MAP). MAP is the product of cardiac output and total peripheral vascular resistance. Importantly, both of these parameters are under the control of the arterial baroreflex and autonomic nervous system. Since cardiac output is the product of heart rate and stroke volume, changes in either of these parameters also influence MAP. In humans, heart rate at rest is largely under the control of the parasympathetic vagus nerve, while vascular tone is sympathetically mediated.


 


A normal MAP is between 70 and 100 mmHg.[3]

If the MAP drops below 60 mmHg, there is a concern there won’t be enough pressure to perfuse vital organs including the brain.6

If the MAP is above 100 mmHg, the patient may be experiencing a high artery pressure. The high pressure experienced in the arteries may lead to blood clots or heart muscle damage. - 

GE Health


Description file located in the package:






https://github.com/wallenr8/Final-R.git





The usage of the MIT license requires 2 additional license files.


License:



Licensemd:



Packages




Program Check() and Build()

I used the Check() and Build() functions built in to test the parameter of my R program and essentially my function. 

^ weight values are enter. BMI is output and evaluation of patient's BMI. Mean arterial pressure or Vascular resistance is derived to be 131.66 mm HG in this experiment

















Test()




Final




Successful computations were made after manual input of SysBP and DiasBP. 1800 L/m (Liters/minute) is the recorded pulse pressure. 


Visualizations


There isnt a legend, from the source code, it should be note that the area between the Blue line(Optimal cardiac output = 2880 L/m and Red line represents the patient's cardiac output = 1800 L/m.  No red line would have meant  there isn't means optimal cardiac output.


The measurement is a representation of a low Mean Arterial Output and the patient will be need to visit his cardiologist perhaps to perform a few electro-cardiographs. We wish him/her the best of luck in his visit. Upon his return I will continue to make improvements to my function where possible.  I am still trying to get a data set to import use read.csv where I can perform more analysis using the Cardiac() function I developed within my package. 


                                                                            

GitHub

The package was successfully installed from GitHub. You can also find the readme.md file located on my GitHub




    BMI RESULTS


Barplot of weight records for the last six months. 
They are very consistent and when this is the case your BMI reading should be normal.

Calculated by inputting your height in inches. and weight values in pounds(lbs). Additional computation can be found in readme.md




Relationships :

 Should be noted that a high BMI , BMI > 30, can be a sign of negative health effects occurring or future sight of High cardiac output, the converse is also true. 

Cardiac Output is directly proportional to the stroke volume since the formula stands at Cardiac Output = SV * HR. Heart rate being treated as a constant. SV is a critical value to keep an eye on and should be monitored through out one's life. or at every doctor's appointment. 

       A change in pulse pressure (delta Pp) is proportional to (stroke)volume change (delta-V) but inversely proportional to arterial compliance (C):

 Delta Pp =  Delta V/C



Because the change in volume is due to the stroke volume of blood ejected from the left ventricle (SV), we can approximate the value of the pulse pressure to be  PP = SV/C.

This experiment is similar to the Stewart-Hamilton equation: = m/C(t)

an equation that shows correlation between the blood flow rate and mass balance. An injected dye will produce an independent mass index that will be divided throughout the concentration time graph. 

Stewart Hamilton EquationRate of bloodflow (Q) can be determined from the rate of change in the concentration of substance after a known amount of it has been added to the bloodstream.

          As you injected the indicator upstream, its circulation past the detector is delayed somewhat. Then, the bulk of the indicator swims by, creating a nice curve.  The value of the indicator at the time of detection is monitored and integrated at some T1 and T2 temporal interval.

Notes: It's almost as if the diluted solution (blood + dye) produces it's own cardiac output at some time (T). 



Complex forms of the Stewart Hamilton's equation:

Area under curve: 
Tdt = area under diluted curve = area between both cardiac output curves

R code for Integrating:
Both cardiac output, well it was a line plot after all 


a <- function(x) {
  return(abs((x^2) + abs(x^2)))
}
integrate(a, 2880, 1800)

## Note Integral was calculated taken with respect to y-axis=(cardiac output) 
##Such that y1 = 1800 and y2=2880/m (opt. CO)

Output: -12037248000 with absolute error < 0.00013 ## cross-section area of change in cardiac output 

##Note... Changes in cardiac output from baseline are directly proportionate to changes in total body oxygen needs. During times of physiologic stress, cardiac output will increase to ensure adequate tissue perfusion.

Programmer:
Romar  Wallen




References

Physiology, pulse pressure - StatPearls - NCBI bookshelf. (2023, July 10). National Center for Biotechnology Information. https://www.ncbi.nlm.nih.gov/books/NBK482408/



The Oxford Handbook of Lifelong Learning. (2021). United Kingdom: Oxford University Press.






https://github.com/wallenr8/Final-R.git












Comments

Popular posts from this blog

R secure coding

Mod 11 debugging