Wednesday, 16 January 2013


R lab_Assignment_15Jan

Question 1

Binding the columns of 2 matrices into a new matrix

a<-mat1[ ,3]
b<-mat2[ ,1]
c<-cbind(a,b)
c


Question 2

Multiplication of two matrices :

mul<-mat1%*%mat2
mul



Question 3

Regression model :
NSE<-read.csv(file.choose(),header=T)
NSE



open<-NSE[ ,2]
high<-NSE[ ,3]
reg<-lm(open~high, data=NSE)
reg
residuals(reg)


Question 4

Normal Distribution

x<-seq(0,100)
y<-dnorm(x, mean=50, sd=10)
plot(x,y, type="l", col="red")









No comments:

Post a Comment