Wednesday, 16 January 2013

Assignment 1


Create two matrices z1 and z2 and bind the first column of z1 with the second column of z2.

Commands

> z1<-c(1:9)
> dim(z1)<-c(3,3)
> z2<-c(32,48,01,05,10,12,15,18,23)
> dim(z2)<-c(3,3)
>  z3<-cbind(z1[,1],z2[,2]) 

Assignment 2


Multiplication of two matrices z1 and z2.

Commands

> z3<-z1%*%z2
> z3

Assignment 3  

Regression 

 

Commands

>nse=read.csv(file.choose(),header=T)
>reg2<-lm(High~Open,data=nse)
> residuals(reg2)

Assignment 4


Commands


Generate a normal distribution data and generate the plot.

>x<-seq(0,500)
> y<-dnorm(x,mean=250,sd=50)
> plot(x,y,type="l")

No comments:

Post a Comment