BUSINESS APPLICATION LAB
DAY 2
Assignment 1:
Create 2 matrices of 3*3 and select 1 column in matrix 1 and matrix 2 merge them into another matrix using cbind command.
command:
z1<-c(1:9)
dim(z1)<-c(3,3)
z2<-c(10:18)
dim(z2)<-c(3,3)
x<-z1[,3]
y<-z2[,1]
z3<-cbind(x,y)
z3
Assignment 2:
multiply matrix 1 and matrix 2
z1%*%z2
Assignment 3:
Read historical data of indices from NSE site from Dec 1 2012 to Dec 31 2012. Find Regression and Residuals.
To read NSE file
nse<-read.csv(file.choose(),header=T)
reg<-lm(high~open,data=nse)
To find residuals
residuals(reg)
Assignment 4:
Generate a Normal distribution data and plot it.
x=seq(70,130,length=200)
y=dnorm(x,mean=100,sd=10)
plot(x,y)




No comments:
Post a Comment