Wednesday, January 23, 2013

ITLAB : Day 3

Assignment 1 
Mileage depends on Grooves. Fit the 'lm' model into the data provided and comment on the applicability.

data<-read.csv(file.choose(),header=T)
reg<-lm(data$mileage~data$groove)
res<-resid(reg)
plot(data$groove,res)

Standardizing the residuals:
sres<-rstandard(reg)
plot(data$groove,sres)


QQ plot of the residuals:
qqnorm(res)
qqline(res)

From the image it can be seen that the qq plot is of Type I and almost a straight line. Hence linearity is valid and the variable is linear in nature.

Assignment 2:
The percentage content of Plutonium depends on the amount of Alpha particles. Fit the 'lm' model into the data provided and comment on the applicability.

data<-read.csv(file.choose(),header=T)
reg<-lm(data$pluto~data$alpha)
res<-resid(reg)
plot(data$alpha,res)


Standardizing the residuals:
sres<-rstandard(reg)
plot(data$alpha,sres)



QQ plot of the residuals:
qqnorm(res)
qqline(res)



From the image it can be seen that the qq plot is of Type I and almost a straight line. Hence linearity is valid and the variable is linear in nature.

Assignment 3:
Compute and comment on the anova analysis of the data provided.

Null Hypothesis: Ho: All chairs have same mean rating for comfort level.

data.anova<-aov(data$ComfortLevel~data$Chair)
summary(data.anova)


As we can see from the summary that the P-value is 0.687. Since this value is very high , we cannot reject the null hypotheses.

Wednesday, January 16, 2013

Business Application Lab - Day 2

Assignment 1:Matrix Binding
z1<-c(1:9)
z1<-c(1,2,3,4,5,6,7,8,9)
dim(z1)<-c(3,3)


z2<-c(1:9)
z2<-c(32,5,15,48,10,18,1,12,23)
dim(z2)<-c(3,3)

x<-z1[,3]
y<-z2[,1]

z3<-cbind(x,y)


Assignment 2:Matrix Multiplication
Using the matrices created in the first assignment
z3<-z1%*%z2
z3


Assignment 3:Regression
nse<-read.csv(file.choose(),header=T)
open<-nse[,2]
high<-nse[,3]

reg<-lm(high~open,data=nse)
reg
residuals(reg)


Assignment 4: Normal Distribution Plot
x<-seq(-5,5,length=200)
y<-dnorm(x,mean=0,sd=1)
plot(x,y,col="red")



Tuesday, January 8, 2013

First day  assignments for R software.


Assignment 1


Assignment 2


Assignment 3

Assignment 4

Assignment 5