Professional Documents
Culture Documents
Stat 8-14
Stat 8-14
Stat 8-14
– 08
AIM: Exercises to find the outliers in a dataset in SPSS.
PROCEDURE:
Step:-1 : Open IBM SPSS in your PC / laptop.
Step:-2 : Define two different variables and add values to it. Make sure to add some values
that differ highly from the usual set of variables.
AIM: Exercises to find the riskiest project out of two mutually exclusive projects in SPSS.
PROCEDURE:
OUTPUT:
SOURCE CODE:
1) Scatter diagram:
OUTPUT:
2) Residual plot:
Y<- iris[,"Sepal.Width"]
X<- iris[,"Sepal.Length"]
# fit a regression model
model <- lm(Y~X)
# get list of residuals
res <- resid(model)
res
# produce residual vs. fitted plot
plot(fitted(model), res)
# add a horizontal line at 0
abline(0,0)
OUTPUT:
SOURCE CODE:
> x <- c(12,15,18,21,27,3,2)
> y <- c(2,4,6,8,12,0,8)
> print(cor(x, y,))
OUTPUT:
[1] 0.625399
SOURCE CODE:
> rainfall <- c(799,174.8,865.1,1334.6,635.4,918.5,681.5,998.6,784.2,935,889.8,1261)
> rainfall <- ts(rainfall,start = c(2021,1),frequency = 12)
> plot(rainfall , main="Time Series Analysis", col='2',lwd=2)
OUTPUT
SOURCE CODE:
SOURCE CODE:
1. Binomial Distribution :
## Coin tossed 5 times probability of getting 2 heads and probability of at most 4 heads
dbinom(x=2, size=5, prob=0.5)
plot(dbinom(x=0:10, size=5, prob=.5), xlab="No.of heads", main="Binomial
Distribution", type='l',
col='2', lwd=3)
2. Poisson Distribution :
dpois(x=2, lambda=2)
plot(dpois(x=0:20, lambda=2), xlab = "No. of observations", main = "Poisson
Distribution", type ="l" ,col='2',lwd=3)