Exercise 1.2 a. My R workspace file is located in my operating system in the following folder: /var/folders/kh/wt4n66yx7yz5yhg03hthh5d40000gn/T//RtmpPUwSlj/downloaded_packages b. users/sergism

  1. HW 1 Epi.Rmd

  2. The following R packages loaded: base, datasets, graphics, grDevices, methods, stats, utils

Exercise 1.3 The difference between integer divide and modulus [remainder] is that the integer divide operation returns everything BUT the remainder. While the modulus operation only returns the remainder. exmample integer divide <- 10%/%3 returns 3 while <- 10%%3 returns 1

Exercise 1.4

#pounds converted to kilograms 
155/2.2
## [1] 70.45455
#feet converted to meters 
5.6/3.3
## [1] 1.69697

#BMI kg/m^2

70.45455/(1.69697)^2
## [1] 24.46587
#BMI= 24.5

#Exercise 1.5

curve(log(x), 0, 6)
abline(v= c(1, exp(1)), h = c(0, 1), lty = 2)

# #Exercise 1.6

curve(x/(1-x), 0, 1)

curve(log(x/(1-x)), 0, 1)

#The log function allows for rearranging the data for more symmytry, which in turn, allows to assume that the odds is closely aligned with risk. Therefore we can assess for risk. #Exercise 1.7

 1-(1-67)^365 #Needle-Sharing
## [1] Inf
 1-(1-50)^365 #receptive anal
## [1] Inf
 1-(1-30)^365 #Needle stick
## [1] Inf
 1-(1-10)^365 #Receptive p-v inter
## [1] Inf
 1-(1-6.5)^365 #Insert anal
## [1] 1.707582e+270
 1-(1-5)^365 #Insert p-v inter
## [1] 5.648028e+219
1-(1-1)^365 #Receptive oral penis 
## [1] 1
 1-(1-0.5)^365 #Insert oral penis
## [1] 1

#The risk of seroconverting from these acts is very high. However, we do not know if condoms or other prophylaxis is used which would lower the cumulutive risk. So, given the lack of information it is hard to estimate cumulutive risk.

#Exercise 1.8 #source(‘~/UC Berkeley/Dropbox (Personal)/PH 251d/Job01.R’, echo=TRUE)

#curve(log(x), 0, 6) #abline(v= c(1, exp(1)), h = c(0, 1), lty = 2)

#source causes R to accept its input from the named file or URL or connection or #expressions directly. Input is read and parsed from that file until the end of the #file is reached, then the parsed expressions are evaluated sequentially in the chosen #environment.