Final Project for LIS4273

 

FinalStatsProjectRCode.R

Tyler House

2021-11-27

#Final R stats Project
#This project will be on the topic of heart disease predictors, and if certain other.....
##

##set directory and load the dataset and entitle heartdata

setwd("C:/users/Tyler/Desktop/FinalStatsProject")

heartdata <- read.csv("heart.csv")

##This dataset is huge and I will select only samples of 100


##Most doctors, other medical professionals and medical editorials will state that most men and women in America in recent years
#tend to have an increasing propensity to have heart disease after the age of 40 due to a variety of factors and combinations of these factors
#the purpose of this analysis is to employ a dataset that revolves around heart disease while simultaneously listing off crucial vital sign data
#that would be predictive of heart disease regardless of the Y/N column that heartdata$HeartDisease is.

##My hypothesis is that people from the ages of 40 onward will have greater heart disease presence despite any other variables influence
#the causes and circumstances of the relationship should be assumed to be unknown and negated, all we know is that there could be a trend simply because data exists

##My alternative hypothesis is that an increase in age or any health related metric does not necessarily dictate a higher heart disease presence among men and women above the age of 40

#Given that I have some medical knowledge and took some time to review large chunks of the data at a time and explore some metrics
#i concluded that there is a good enough spread to take multiple samples and achieve a high level of random selection.

#We want to derive some values in order to start our analysis so, we will need the mean, range and number of each of the columns

mean(heartdata$Age)

## [1] 53.51089

range(heartdata$Age)

## [1] 28 77

mean(heartdata$HeartDisease)

## [1] 0.5533769

range(heartdata$HeartDisease)

## [1] 0 1

mean(heartdata$Cholesterol)

## [1] 198.7996

range(heartdata$Cholesterol)

## [1]   0 603

#The above values are calculated for every single observation in the dataset, now lets take some samples!!
#we will take 100 member samples for each of the three at random

#sub1 is the initial constraint for the sample and that is to select only two columns which is the presence of heart disease and the age of the person
#I want to mention that sub1 will instrumental to the development of the compounded subset that will define the data used to draw samples from

sub1 <- subset(heartdata, HeartDisease = 1 , select = c(HeartDisease,Age) )

#This subset will be used to derive the samples, sub1 is the prensence of heart disease for all entities in the dataset
##and sampledata combines this with the constraint of all entities for the cleaned data being over the age of 40, omitting over 300 entities.

uppersampledata <- subset(sub1, Age > 40, select = c(HeartDisease,Age))

lowersampledata <- subset(sub1, Age < 40, select = c(HeartDisease,Age))

print(uppersampledata)

##     HeartDisease Age
## 2              1  49
## 4              1  48
## 5              0  54
## 7              0  45
## 8              0  54
## 10             0  48
## 12             1  58
## 14             1  49
## 15             0  42
## 16             0  54
## 18             0  43
## 19             1  60
## 21             0  43
## 22             0  44
## 23             0  49
## 24             1  44
## 27             0  53
## 28             0  52
## 29             0  53
## 30             0  51
## 31             1  53
## 32             0  56
## 33             1  54
## 34             1  41
## 35             0  43
## 37             1  65
## 38             0  41
## 39             0  48
## 40             0  48
## 41             0  54
## 42             1  54
## 44             0  52
## 45             1  43
## 46             0  59
## 48             0  50
## 50             1  41
## 51             1  50
## 52             1  47
## 53             0  45
## 54             0  41
## 55             0  52
## 56             0  51
## 58             1  58
## 59             0  54
## 60             1  52
## 61             0  49
## 62             0  43
## 63             0  45
## 64             1  46
## 65             0  50
## 67             0  45
## 69             1  52
## 70             0  44
## 71             1  57
## 72             0  44
## 73             1  52
## 74             0  44
## 75             1  55
## 76             0  46
## 79             0  52
## 80             1  49
## 81             0  55
## 82             0  54
## 83             1  63
## 84             0  52
## 85             1  56
## 86             1  66
## 87             1  65
## 88             0  53
## 89             1  43
## 90             0  55
## 91             0  49
## 93             0  52
## 94             1  48
## 96             1  58
## 97             0  43
## 99             0  56
## 100            0  41
## 101            1  65
## 102            0  51
## 105            1  46
## 106            0  57
## 107            0  48
## 109            0  50
## 111            0  59
## 112            1  57
## 113            0  47
## 115            0  49
## 118            1  59
## 121            1  47
## 122            0  52
## 123            0  46
## 124            1  58
## 125            0  58
## 126            0  54
## 128            0  48
## 129            0  54
## 130            0  42
## 132            1  46
## 133            1  56
## 134            1  56
## 135            0  61
## 136            1  49
## 137            0  43
## 139            1  54
## 140            1  43
## 141            1  52
## 142            1  50
## 143            1  47
## 144            0  53
## 145            1  56
## 147            0  42
## 148            0  43
## 149            0  50
## 150            1  54
## 152            0  48
## 154            0  55
## 155            0  41
## 156            1  56
## 158            0  49
## 159            1  44
## 160            0  54
## 161            1  59
## 162            1  49
## 163            0  47
## 164            0  42
## 165            0  52
## 166            1  46
## 167            1  50
## 168            0  48
## 169            0  58
## 170            0  58
## 173            0  53
## 174            0  49
## 175            1  52
## 176            1  43
## 177            1  54
## 178            0  59
## 180            0  46
## 181            1  52
## 182            0  51
## 183            1  52
## 184            0  46
## 185            0  54
## 186            1  58
## 187            0  58
## 188            1  41
## 189            0  50
## 190            1  53
## 191            0  46
## 192            0  50
## 193            0  48
## 194            0  45
## 195            0  41
## 196            0  62
## 197            0  49
## 198            0  42
## 199            1  53
## 200            0  57
## 201            0  47
## 202            0  46
## 203            0  42
## 205            0  56
## 206            0  50
## 210            1  54
## 211            1  48
## 212            1  50
## 213            0  56
## 214            0  56
## 215            1  47
## 218            0  54
## 219            0  55
## 221            1  46
## 222            1  51
## 223            0  48
## 225            0  55
## 226            1  50
## 227            0  53
## 229            0  41
## 234            0  41
## 235            0  54
## 237            1  41
## 238            1  55
## 239            1  48
## 240            1  48
## 241            0  55
## 242            1  54
## 243            1  55
## 244            0  43
## 245            1  48
## 246            0  54
## 247            1  54
## 248            1  48
## 249            1  45
## 250            1  49
## 251            1  44
## 252            1  48
## 253            0  61
## 254            0  62
## 255            1  55
## 256            0  53
## 257            0  55
## 259            0  51
## 260            0  55
## 261            0  46
## 262            0  54
## 263            1  46
## 264            1  59
## 265            1  47
## 266            0  54
## 267            1  52
## 269            1  54
## 270            0  47
## 271            0  45
## 273            1  55
## 274            0  55
## 275            0  45
## 276            0  59
## 277            1  51
## 278            1  52
## 279            0  57
## 280            0  54
## 281            0  60
## 282            1  49
## 283            0  51
## 284            0  55
## 285            0  42
## 286            0  51
## 287            0  59
## 288            0  53
## 289            0  48
## 291            0  48
## 292            0  47
## 293            0  53
## 294            1  65
## 296            1  61
## 297            1  50
## 298            1  57
## 299            1  51
## 300            1  47
## 301            1  60
## 302            0  55
## 303            1  53
## 304            1  62
## 305            1  51
## 306            1  51
## 307            1  55
## 308            0  53
## 309            1  58
## 310            1  57
## 311            0  65
## 312            1  60
## 313            1  41
## 315            0  53
## 316            1  74
## 317            1  57
## 318            1  56
## 319            1  61
## 320            1  68
## 321            1  59
## 322            1  63
## 324            1  62
## 325            1  46
## 326            1  42
## 327            0  45
## 328            1  59
## 329            1  52
## 330            1  60
## 331            1  60
## 332            1  56
## 335            1  51
## 336            1  62
## 337            0  72
## 338            1  63
## 339            1  63
## 340            1  64
## 341            1  43
## 342            1  64
## 343            1  61
## 344            1  52
## 345            1  51
## 346            1  69
## 347            1  59
## 348            1  48
## 349            1  69
## 351            1  53
## 352            1  43
## 353            1  56
## 354            1  58
## 355            1  55
## 356            1  67
## 357            1  46
## 358            1  53
## 360            1  53
## 361            1  62
## 362            1  47
## 363            1  56
## 364            1  56
## 365            0  56
## 366            1  64
## 367            1  61
## 368            1  68
## 369            1  57
## 370            1  63
## 371            1  60
## 372            1  66
## 373            1  63
## 374            1  59
## 375            1  61
## 376            1  73
## 377            1  47
## 378            1  65
## 379            1  70
## 380            1  50
## 381            1  60
## 382            1  50
## 383            1  43
## 385            1  54
## 386            1  61
## 387            1  42
## 388            1  53
## 389            1  55
## 390            1  61
## 391            1  51
## 392            1  70
## 393            1  61
## 395            1  57
## 397            1  62
## 398            1  58
## 399            1  52
## 400            1  61
## 401            1  50
## 402            1  51
## 403            1  65
## 404            1  52
## 405            1  47
## 407            1  57
## 408            1  62
## 409            1  59
## 410            1  53
## 411            1  62
## 412            1  54
## 413            1  56
## 414            1  56
## 415            1  54
## 416            1  66
## 417            1  63
## 418            0  44
## 419            1  60
## 420            1  55
## 421            0  66
## 422            0  66
## 423            1  65
## 424            0  60
## 425            1  60
## 426            1  60
## 427            0  56
## 428            1  59
## 429            1  62
## 430            1  63
## 431            1  57
## 432            0  62
## 433            1  63
## 434            1  46
## 435            0  63
## 436            0  60
## 437            1  58
## 438            1  64
## 439            1  63
## 440            0  74
## 441            1  52
## 442            1  69
## 443            1  51
## 444            1  60
## 445            1  56
## 446            1  55
## 447            1  54
## 448            1  77
## 449            1  63
## 450            1  55
## 451            1  52
## 452            1  64
## 453            1  60
## 454            0  60
## 455            1  58
## 456            0  59
## 457            1  61
## 459            1  61
## 460            0  41
## 461            1  57
## 462            1  63
## 463            1  59
## 464            0  51
## 465            1  59
## 466            0  42
## 467            1  55
## 468            0  63
## 469            1  62
## 470            0  56
## 471            1  53
## 472            1  68
## 473            1  53
## 474            1  60
## 475            0  62
## 476            1  59
## 477            0  51
## 478            1  61
## 479            1  57
## 480            1  56
## 481            1  58
## 482            1  69
## 483            1  67
## 484            1  58
## 485            1  65
## 486            1  63
## 487            0  55
## 488            1  57
## 489            0  65
## 490            1  54
## 491            1  72
## 492            1  75
## 493            1  49
## 494            1  51
## 495            1  60
## 496            1  64
## 497            0  58
## 498            1  61
## 499            1  67
## 500            1  62
## 501            1  65
## 502            1  63
## 503            1  69
## 504            0  51
## 505            1  62
## 506            1  55
## 507            1  75
## 509            1  67
## 510            1  58
## 511            0  60
## 512            1  63
## 514            1  62
## 515            1  43
## 516            0  63
## 517            1  68
## 518            1  65
## 519            1  48
## 520            1  63
## 521            0  64
## 522            1  61
## 523            1  50
## 524            1  59
## 525            0  55
## 526            0  45
## 527            1  65
## 528            0  61
## 529            1  49
## 530            1  72
## 531            1  50
## 532            1  64
## 533            1  55
## 534            1  63
## 535            1  59
## 536            1  56
## 537            1  62
## 538            1  74
## 539            1  54
## 540            0  57
## 541            1  62
## 542            1  76
## 543            1  54
## 544            1  70
## 545            0  61
## 546            0  48
## 547            1  48
## 548            1  61
## 549            1  66
## 550            0  68
## 551            1  55
## 552            0  62
## 553            1  71
## 554            1  74
## 555            0  53
## 556            1  58
## 557            0  75
## 558            1  56
## 559            1  58
## 560            1  64
## 561            0  54
## 562            0  54
## 563            0  59
## 564            1  55
## 565            1  57
## 566            1  61
## 567            0  41
## 568            1  71
## 570            1  55
## 571            1  56
## 572            1  69
## 573            1  64
## 574            1  72
## 575            1  69
## 576            1  56
## 577            1  62
## 578            1  67
## 579            1  57
## 580            1  69
## 581            1  51
## 582            1  48
## 583            1  69
## 584            0  69
## 585            1  64
## 586            1  57
## 587            1  53
## 589            1  67
## 590            1  74
## 591            0  63
## 592            0  58
## 593            1  61
## 594            1  64
## 595            1  58
## 596            1  60
## 597            1  57
## 598            0  55
## 599            1  55
## 600            1  56
## 601            0  57
## 602            1  61
## 603            1  61
## 604            1  74
## 605            0  68
## 606            0  51
## 607            1  62
## 608            1  53
## 609            1  62
## 610            1  46
## 611            1  54
## 612            0  62
## 613            1  55
## 614            0  58
## 615            1  62
## 616            1  70
## 617            0  67
## 618            1  57
## 619            0  64
## 620            0  74
## 621            0  65
## 622            1  56
## 623            1  59
## 624            1  60
## 625            1  63
## 626            0  59
## 627            0  53
## 628            0  44
## 629            1  61
## 630            0  57
## 631            0  71
## 632            1  46
## 633            1  53
## 634            0  64
## 636            1  67
## 637            0  48
## 638            0  43
## 639            0  47
## 640            0  54
## 641            0  48
## 642            0  46
## 643            0  51
## 644            1  58
## 645            0  71
## 646            1  57
## 647            0  66
## 649            1  59
## 650            1  50
## 651            1  48
## 652            1  61
## 653            1  59
## 654            0  42
## 655            0  48
## 657            0  62
## 658            0  44
## 659            0  46
## 660            1  59
## 661            0  58
## 662            1  49
## 663            1  44
## 664            1  66
## 665            1  65
## 666            1  42
## 667            0  52
## 668            0  65
## 669            0  63
## 670            0  45
## 671            0  41
## 672            1  61
## 673            0  60
## 674            1  59
## 675            1  62
## 676            0  57
## 677            1  51
## 678            0  44
## 679            0  60
## 680            0  63
## 681            1  57
## 682            0  51
## 683            1  58
## 684            0  44
## 685            1  47
## 686            1  61
## 687            0  57
## 688            0  70
## 689            0  76
## 690            0  67
## 691            1  45
## 692            0  45
## 694            0  42
## 695            0  56
## 696            1  58
## 698            1  58
## 699            0  41
## 700            0  57
## 701            0  42
## 702            0  62
## 703            0  59
## 704            0  41
## 705            1  50
## 706            0  59
## 707            1  61
## 708            1  54
## 709            1  54
## 710            1  52
## 711            1  47
## 712            0  66
## 713            1  58
## 714            0  64
## 715            0  50
## 716            0  44
## 717            1  67
## 718            0  49
## 719            1  57
## 720            1  63
## 721            1  48
## 722            0  51
## 723            1  60
## 724            1  59
## 725            0  45
## 726            1  55
## 727            0  41
## 728            1  60
## 729            0  54
## 730            0  42
## 731            0  49
## 732            1  46
## 733            1  56
## 734            0  66
## 735            1  56
## 736            1  49
## 737            1  54
## 738            1  57
## 739            0  65
## 740            0  54
## 741            0  54
## 742            1  62
## 743            0  52
## 744            0  52
## 745            1  60
## 746            1  63
## 747            1  66
## 748            0  42
## 749            1  64
## 750            0  54
## 751            0  46
## 752            0  67
## 753            1  56
## 755            0  57
## 756            1  64
## 757            0  59
## 758            1  50
## 759            0  51
## 760            1  54
## 761            1  53
## 762            1  52
## 764            1  58
## 765            0  41
## 766            0  41
## 767            0  50
## 768            0  54
## 769            0  64
## 770            0  51
## 771            0  46
## 772            1  55
## 773            0  45
## 774            0  56
## 775            1  66
## 777            1  62
## 778            0  55
## 779            1  58
## 780            0  43
## 781            0  64
## 782            0  50
## 783            0  53
## 784            0  45
## 785            1  65
## 786            0  69
## 787            1  69
## 788            1  67
## 789            0  68
## 791            1  62
## 792            1  51
## 793            1  46
## 794            1  67
## 795            0  50
## 796            0  42
## 797            1  56
## 798            1  41
## 799            0  42
## 800            0  53
## 801            0  43
## 802            1  56
## 803            0  52
## 804            0  62
## 805            1  70
## 806            0  54
## 807            1  70
## 808            0  54
## 810            0  48
## 811            0  55
## 812            0  58
## 813            0  54
## 814            0  69
## 815            1  77
## 816            0  68
## 817            1  58
## 818            1  60
## 819            1  51
## 820            1  55
## 821            0  52
## 822            0  60
## 823            0  58
## 824            1  64
## 826            1  59
## 827            0  51
## 828            0  43
## 829            1  58
## 831            0  41
## 832            0  63
## 833            0  51
## 834            0  54
## 835            0  44
## 836            1  54
## 837            1  65
## 838            0  57
## 839            1  63
## 841            0  41
## 842            1  62
## 843            1  43
## 844            0  58
## 845            0  52
## 846            1  61
## 848            0  45
## 849            1  52
## 850            0  62
## 851            1  62
## 852            0  53
## 853            1  43
## 854            0  47
## 855            0  52
## 856            1  68
## 858            0  53
## 859            1  62
## 860            0  51
## 861            1  60
## 862            1  65
## 863            0  65
## 864            1  60
## 865            1  60
## 866            1  54
## 867            0  44
## 868            1  44
## 869            0  51
## 870            0  59
## 871            0  71
## 872            0  61
## 873            1  55
## 874            1  64
## 875            0  43
## 876            0  58
## 877            1  60
## 878            1  58
## 879            0  49
## 880            1  48
## 881            0  52
## 882            0  44
## 883            0  56
## 884            0  57
## 885            1  67
## 886            0  53
## 887            0  52
## 888            1  43
## 889            1  52
## 890            1  59
## 891            0  64
## 892            0  66
## 894            1  57
## 895            0  58
## 896            1  57
## 897            0  47
## 898            1  55
## 900            1  61
## 901            1  58
## 902            1  58
## 903            0  58
## 904            0  56
## 905            0  56
## 906            1  67
## 907            0  55
## 908            1  44
## 909            1  63
## 910            1  63
## 911            0  41
## 912            1  59
## 913            1  57
## 914            1  45
## 915            1  68
## 916            1  57
## 917            1  57

print(lowersampledata)

##     HeartDisease Age
## 3              0  37
## 6              0  39
## 9              1  37
## 11             0  37
## 13             0  39
## 17             1  38
## 20             1  36
## 26             0  36
## 36             0  32
## 43             0  35
## 47             0  37
## 49             0  36
## 57             1  31
## 66             0  37
## 68             0  32
## 77             1  32
## 78             0  35
## 92             0  39
## 95             0  39
## 98             0  39
## 108            0  34
## 110            0  39
## 114            0  38
## 116            1  33
## 117            1  38
## 119            0  35
## 120            1  34
## 127            0  34
## 131            0  38
## 138            0  39
## 146            0  39
## 151            0  39
## 157            1  38
## 171            0  29
## 179            0  37
## 204            0  31
## 207            0  35
## 208            1  35
## 209            0  28
## 216            0  30
## 217            1  39
## 220            0  29
## 224            0  33
## 228            1  38
## 230            0  37
## 231            0  37
## 233            0  38
## 236            0  39
## 258            0  36
## 268            0  34
## 272            0  32
## 290            0  36
## 295            1  32
## 314            1  34
## 323            1  38
## 333            0  38
## 350            1  36
## 359            1  38
## 384            1  38
## 394            1  38
## 396            1  38
## 406            1  35
## 513            0  35
## 569            1  38
## 588            0  37
## 648            0  37
## 693            0  39
## 697            1  35
## 754            0  34
## 776            1  38
## 790            0  34
## 809            1  35
## 825            0  37
## 830            0  29
## 840            0  35
## 847            1  39
## 857            0  39
## 893            0  39
## 899            0  35
## 918            0  38

#As you can see, the data shown from sample data is just a refined list of two vectors, of 574 cleaned data entries that list their number of entry at random, age and presence of heart disease (0/1)

#I will comment them out because everytime the code is run the numbers change and I aim to preserve consistency
#there will be a sample self titled for what data entries they hold either over or under the age of forty with proper constraints

overforty <- sample(uppersampledata$HeartDisease, 40, replace = FALSE, prob = NULL)

underforty <- sample(lowersampledata$HeartDisease, 40, replace = FALSE, prob = NULL)

##Load libraries

library(dplyr)

##
## Attaching package: 'dplyr'

## The following objects are masked from 'package:stats':
##
##     filter, lag

## The following objects are masked from 'package:base':
##
##     intersect, setdiff, setequal, union

library(stats)
library(EnvStats)

##
## Attaching package: 'EnvStats'

## The following objects are masked from 'package:stats':
##
##     predict, predict.lm

## The following object is masked from 'package:base':
##
##     print.default

library(ISwR)

#Two way T-Test using overforty and underforty, both derived from the 918 observation "heartdata".

t.test(overforty,underforty)

##
##  Welch Two Sample t-test
##
## data:  overforty and underforty
## t = 2.0564, df = 77.718, p-value = 0.0431
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.00716346 0.44283654
## sample estimates:
## mean of x mean of y
##     0.550     0.325

#Welch Two Sample t-test

#data:  overforty and underforty
#t = 1.5744, df = 77.942, p-value = 0.1195
#alternative hypothesis: true difference in means is not equal to 0
#95 percent confidence interval:
#  -0.04629819  0.39629819
#sample estimates:
#  mean of x mean of y
#0.550     0.375

#These results boast a very small p value which would suggest that we reject the null hypothesis as there are factors outside of chance
#that caused this trend

#this experiment left little room for underforty as the majority of the people of the near 1000 in the dataset were over 40. These results would suggest that if age was the only factor, it would not be enough to be a primary cause of the rise in heart disease presence
#thee results would also go against what most will say over the age of forty, so lets try something else.

#the results may differ if we put heart disease presence and a max resting heart rate

#Lets repeat the above steps and entitle here forth a subsection using heart disease presence, people over the age of forty who have
#heart rates over 140 is like running an inline motor at half load, its a reasonable amount of stress the heart is under. The point of this is to use this metric to make predictions about the hearts ability
#and capacity to handle strenuous aerobic activity as age progresses, regardless of biological sex.

##Null Hypothesis: Patients over the age of forty have higher heart disease presence when their max heart rate is over 140

range(heartdata$MaxHR)

## [1]  60 202

#lets set the threshold for members of these new samples to be a max  heart rate above 140

sub2 <- subset(heartdata, HeartDisease = 1, select = c(HeartDisease, MaxHR))

upperHRsplit <- subset(sub2, MaxHR > 140, select = c(HeartDisease, MaxHR))
 
lowerHRsplit <- subset(sub2, MaxHR < 140, select = c(HeartDisease, MaxHR))

#Two Way T Test for Heart Rate and Heart Disease

sampleUHR <- sample(upperHRsplit$HeartDisease, 40, replace = FALSE, prob = NULL)

sampleLHR <- sample(lowerHRsplit$HeartDisease, 40, replace = FALSE, prob = NULL)

t.test(sampleUHR, sampleLHR)

##
##  Welch Two Sample t-test
##
## data:  sampleUHR and sampleLHR
## t = -4.1867, df = 76.66, p-value = 7.481e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.6271486 -0.2228514
## sample estimates:
## mean of x mean of y
##     0.350     0.775

plot(heartdata$Age,heartdata$MaxHR, xlab = "Age", ylab = "Max Resting Heartrate")

abline(lm(heartdata$MaxHR~heartdata$Age))

title("Heart Rate vs Age ")











#This visual shows a plot with a trendline that shows a linearly decreasing heart rate capacity as people age. Intuitively there are many conclusions that we can draw from the results

#Heart disease is a multivariate issue and cannot be referenced and tested off two variables alone

#The concentrations of people at certain ages having certain heart rates begins to cluster heavily between 40 and 60, presumably because most people that age are well within a career that typically is sedentary.
#Even if they are in blue collar industries, many of the more experienced workers work in management or are a foreman or lead.

#with the p value of this specific test of these samples being run, will be very close to 0 which would suggest that heart disease presnece and a high resting heart rate is not enough of a contraint
#to be able to identify if certain metrics have a dominating effect on human health over the age of 40.

#This analysis and hypothesis was constructed to explore the following concepts

  # How that not all statistical tests and metrics give full context to another issue

  # That these tests conversely from the prior, may help statisticians and other data professionals gain a better grasp
    ##at the depths and complexities of the problems they face in the working world

#My hypothesis and alternate here as follows

#H0-Presence of heart disease and other metric extremes ALONE do not dictate the presence of heart disease or bad health over the age of 40
#HA- Other factors are present that determine heart disease presence over a certain age (ex. Patient D has high heart rate and heart disease but is also a smoker, but not all smokers have heart disease)

#I found this hypothesis to pick at the bones of the skeleton that is the delicate intricacies of analytic mathematics, performing and conducting experiments alone is not enough to solve a problem.
#defining proper constraint and analogous ones with different, but related data will reveal trends that will advocate towards the probability of extenuating circumstances being present of not.

#A two sided t test was needed because i intended on taking multiple samples and the variances of any sample that I have taken and/or
## will take is going to have a similar but different variance at least out to 4 decimal places which is enough of a difference to throw off results
##The p value for every time the code was run on both sections was close to zero which means that essentially there is a high probability of rejecting the null rather than failing to reject.
##additionally, these findings go more towards a more accurate anecdote in public and over dinner "Everything in Moderation".
##Heart disease can be caused by numerous things and a combination of such, the some important things to remember that humans follow similar trends simply because the only thing we have in common among billions of characteristics, is that we are humans on earth.
##There is so much variation and so many differences that makes the world what it is and using these tools and these mindsets to solve problems helps us as academics to keep the best interest of our work a top priority.

Comments

Popular posts from this blog

R Package: pfStat

Module 7 Assignment

The Tampa Feasibility Report featuring R based Visualizations