# Generate the data with S distribution
xreg <- cbind(rnorm(100,10,3),rnorm(100,50,5))
xreg <- cbind(100+0.5*xreg[,1]-0.75*xreg[,2]+rs(100,0,3),xreg)
colnames(xreg) <- c("y","x1","x2")
# Fit the normal distribution model
ourModel <- alm(y~x1+x2, xreg, distribution="dnorm")
# Detect outliers
xregOutlierDummy <- outlierdummy(ourModel)
Run the code above in your browser using DataLab