1. The first demand of this assignment is to initialize the "Introduction to Statistics with R" data package "ashina". After inputting the package, I ran the file and received this result on my console:
This data set is representative of a trial being conducted on a headache medication containing no synthase inhibitor. The study included 16 patients; a baseline of pain was used on a scale of 5, the difference between the baseline and pain recorded after a certain period of time was used to determine a score. Six patients were treated with the medication in the first session and given the placebo during the second; ten patients were given the placebo first and medication second. The order in which this method was applied was randomized.
I wanted to see the structure and a summary of the data so I used the str() and summary() function after creating a vector called "ashina" to make the ISwR data more accessible. The output of these commands are:The structure() function gives us the number of observations (number of participants) and the number of variables used within the experiment (real medication, placebo, and the group number respectively). The summary gives us an idea of the quantitative characteristics of the data set for each variable. This information is helpful, but not the goal of this assignment; using the hint provided, applying the code allows us to distinguish the data into two groups: the treated and untreated, regardless of session or group. This will allow us to be more tactile with the data and apply the logistic regression and t tests on treatment. Placing the treated data into the "act" data frame and untreated into "plac", we can make presumptions based on the data.
Using these new data frames, we can run our t tests and regression analyses.
2. For this question, we are given a series of vectors containing numbers and lists.
a <- c(2, 2, 8)
b <- c(2, 4, 8)
x <-- c(1:8)
y <- c(1:4, 8:5)
z <- rnorm (8)
Using the rnorm() function, we are given a random series of normally distributed numbers. The implications of this suggest that any and all inputs will be normally distributed and follow the behavioral patterns of the typical curve and qualities of of the data structure. After initializing the vectors, I messed around with the rnorm function to see what the results were:
I don't really understand what the model.matrix function is meant to accomplish in regards to the question or the vectors. When I try to apply the same equations or relationships used as examples, I get error messages.
No comments:
Post a Comment