Thursday, 24 January 2013

ITBAL Assignment3


Assignment 1 (a) -Groove Milage Data

Fit ‘lm’ and comment on the applicability of ‘lm’
Plot1: Residual vs Independent curve
Plot2: Standard Residual vs independent curve



As the plot is parabolic, so we will not be able to do regression.

Assignment 1 (b) -Alpha-Pluto Data

Fit ‘lm’ and comment on the applicability of ‘lm’
Plot1: Residual vs Independent curve
Plot2: Standard Residual vs independent curve


Qq plot
Qqline



As this is a random plot, thus we can have regression.

QQPlot


 QQLine



Assignment 2: Justify Null Hypothesis using ANOVA


p value=0.687

Since p-value is greater than 5%, we cannot reject the null hypothesis. 

Tuesday, 15 January 2013

ITBAL Assignment 2


Assignment1          a.       Create two matrices          b.       Select two columns          c.       Use cbind to create a new matrix


> x<- c(19,10,15,100,27,45,51,73,62)
> dim(x)<- c(3,3)
> x
     [,1] [,2] [,3]
[1,]   19  100   51
[2,]   10   27   73
[3,]   15   45   62
> mat2<- c(32,48,01,05,10,12,15,18,21)
> dim(mat2)<- c(3,3)
> col1<- mat2[ ,1]
> col1
[1] 32 48  1
> z<- cbind(col3,col1)
> z
     col3 col1
[1,]   51   32
[2,]   73   48
[3,]   62    1 

Assignment2             a.       Multiply  matrix1 and matrix2


> mult<- x%*%mat2
> mult
     [,1] [,2] [,3]
[1,] 5459 1707 3156
[2,] 1689 1196 2169
[3,] 2702 1269 2337

Assignment3              a.       Regression of NSE downloaded data 01/12/12-31/21/12

> data2<- read.csv(file.choose(),header=T)
> reg1<- lm(High~Open,data=data2)
> reg1

Call:
lm(formula = High ~ Open, data = data2)
Coefficients:
(Intercept)         Open 
  1578.3358       0.7355

Assignment 4:              a.        Plot a Normally Distributed Data

x<-seq(-10,10,by=0.1)
y<-dnorm(x, mean=0, sd=12)
plot(x,y, type="l")


Tuesday, 8 January 2013

ITBAL Assignment


Assignment 0
Plot histogram of 1 dimensional data
> x<-c(1,2,3)
> plot(x,type="h")

Assignment 1
Plot histogram of a single col from NSE data
>zcol1<-z[,3]
> plot(zcol1,type="h")



Assignment 2
Plot the above in line –point form
> plot(zcol1,type="b")
> main="NSE Graph"
> plot(zcol1,type="b",main="NSE Graph")
> plot(zcol1,type="b",main="NSE Graph",xlab="Time",ylab="Nifty")

Assignment 3
Scatterplot of Low value of Index
> zcol2<- z[,4]
>plot(zcol1,zcol2)

Assignment 4
Find the volatility of indices
> mergedata<- c(zcol1,zcol2)
> summary(mergedata)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
   4888    5660    5723    5758    5884    6021
> range(mergedata)
[1] 4888.20 6020.75