title: “HW 2 PSYCH 705” author: “Lindsey Decker, Andrew Dorsch, Chase Herndon” date: “2/15/2022” output: html_document

Question 1

Creating Matrices

A <- c(1,2,3,2,5,6,3,6,9)

A <- matrix(data = A, nrow=3, ncol=3)



B <- c(1,0,0,0,1,0,0,0,1)

B <- matrix(data = B, nrow=3, ncol=3)


C <- c(1,2,3,2,5,6,3,6,9)

C <- matrix(data = A, nrow=3, ncol=3)

A
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    2    5    6
## [3,]    3    6    9
B
##      [,1] [,2] [,3]
## [1,]    1    0    0
## [2,]    0    1    0
## [3,]    0    0    1
C
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    2    5    6
## [3,]    3    6    9

Adding and subtracting Matrices

A + C
##      [,1] [,2] [,3]
## [1,]    2    4    6
## [2,]    4   10   12
## [3,]    6   12   18
A - C
##      [,1] [,2] [,3]
## [1,]    0    0    0
## [2,]    0    0    0
## [3,]    0    0    0
A*B
##      [,1] [,2] [,3]
## [1,]    1    0    0
## [2,]    0    5    0
## [3,]    0    0    9
(A+B)^-1*(C+B)
##      [,1] [,2] [,3]
## [1,]    1    1    1
## [2,]    1    1    1
## [3,]    1    1    1

Question 2

#a) We can see there is a constant and parameters entered in without any adjustments which is good, but the model is missing the epislon signifying error; therefore this is not a linear model.   

#b) Here we see there is no constant within the model, therefore, this is not a linear model

#c) Here we see the beta term parameter is being transformed, and not the beta weight. Therefore, this is not a linear model. 

#d) Similar to the example above, the parameter of beta 1 is being transformed; therefore, this is not a linear model. 

Question 3

B0 <- -0.34

B1 <- 1.04
 
x = c(seq(from = 0, to = 3, by = .2))
x
##  [1] 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0
a = B0 + B1*(x^2)

plot(a)

b = B1*exp(x)

plot(b)

c = B0 + exp(B1*x)

plot(c)

d = B0 + exp(log(B1)*x)

plot(d)

Question 4

# yi(6.6) = b0(1) + b1(2) + ei

# yi(2.2) = bo(1) + b1(5) + ei

# yi(-1.1) = b0(1) + b1(6) + ei 

Question 5

#Data were obtained through the Scripps Institution of Oceanography (SIO) and the Scripps website (Scrippsco2.ucsd.edu). The dataset includes the year data was collected, along with the average CO2, abbreviated as 'ppm'. Estimated uncertainty is represented as 'unc' and is the standard deviation of annual mean values. 

Question 6