• Home
  • University of Lincoln
  • Data Skills for Life Sciences
  • Data Analysis and Visualization in Life Sciences

Data Analysis and Visualization in Life Sciences

Data Analysis Q1.1) Create three data subsets using dplyr methods, one for each species. Use these subsets to calculate (a) a mean of antibac for each species [3 marks] Mean of scotia = 3.47 Mean of veris = 2.82 Mean of vulgaris = 2.94 (b) a standard deviation of antibac for each species [3 marks] S.D of scotia = 0.37 S.D of veris = 0.29 S.D of Vulgaris = 0.34 Q1.2) Plot a density plot of antibac for each species using ggplot methods [3 marks], and: • use a different fill colour for each species [1 mark] · make sure that the graph is understandable (i.e. sensible axis labels, axis limits, etc.) [1 mark] You may provide these as three separate plots [up to 5 marks], or provide all three on the same plot [for 1 additional mark] 1.5 1.0 species Density scotia veris vulgaris 0.5 0.0 2.5 3.0 3.5 4.0 4.5 Diameter of antibacterial clear zones of the nectar (mm) Q 2.1) Using ggplot methods, plot a scatter plot that represents an interaction relationship between sugars and species influencing antibac [3 marks]. This represents the hypothesis that the relationship between the sugar content of nectar and its antibacterial potency depends on the species. This interaction graph should have • different colour points for each species [1 mark] • a line of best fit for each species, colored to match the points [1 mark] make sure that the graph is understandable (i.e., sensible axis labels, axis limits, etc.) [1 mark] 4.5 4.0 . . 3.5 Diameter of antibacterial clear zones of the nectar (mm) . . . . . species - scotia - veris - vulgaris . 3.0 . 2.5 50 60 70 80 Concentration of sugar (percentage weight that consists of sugars) Q 3.1) Assuming the response variable has a Normal (Gaussian) distribution and can therefore be analyzed using a standard GLM, construct a general linear model using either the glm() or the lm() functions, that represents the interaction relationship from question 2. To reiterate, this is the interaction relationship between sugars and species influencing antibac and represents the hypothesis that the relationship between the sugar content of nectar and its antibacterial potency depends on the species. Please fill out answers to the following questions: (b) What is the 'model formula' that you type into the glm() or lm( ) function? [2 marks] glm(y ~ x1*x2, data = data frame) (c) How many parameters (slopes and intercepts) are in the resulting GLM? [1 mark] tt (3 slopes and 3 intercepts) (c) State i. The intercept for the Primula scotia fitted line; ii. The slope for the Primula scotia fitted line, and iii. The predicted value of antibac for a Primula scotia flower with 50% value of sugars. [3 marks] intercept for scotia: ff0.29 ii) slope for scotia: 1.93 iii) predicted value of antibac for scotia with 50% value of sugars: tt.83 [-0.29404+(1.37271x50) ] Q3.2) Plot diagnostic plots of the model fit of your GLM model from 3.1, in order