Zahoor Ahmad

 

Home

AIOU

MIU

IMCB H9

Contact

Commands set-1 in R

q()
2+3
7-4
2*4
4/3
14%%3
2^3
x <- 2+3
x1 = 7+3
y = c(1:10)
y = c(1,5, 6, 8, 3, 6, 2, 10)
y1 = c(1:10)
length(y)
y[3]
y[3] = 23
fix(y)
ys = sort(y)
ysD = sort(y, decreasing = T)
ysD
mean(y)
length(y)
sum(y)
var(y)
median(y)
sd(y)
range(y)
ry = range(y)
ry[1]
ry[2]
ry[2] - ry[1]
data1 = rbinom(100, 10, .3)
mean(data1)
boxplot(data1)
hist(data1)
quantile(data1)
quantile(data1, prob = .4)
quantile(data1, prob = c(.15, .40, 0.62, 0.99))
summary(data1)
sqrt(9)
frData1 = table(data1)
frData1 = table(data2)
x2 = seq(1:5, by = 0.5)
x3 = seq(0,50, by = 5)
x3 = seq(0,50, len = 5)
x4 = rep(1:5, times = 3)
x5 = rep(c(1,3,5), times = 3)
x51 = rep(y, times = 3)
x52 = rep(y, each = 3)
x5[5:12]
subX5 = x5[5:12]
subX5 = x5[-(5:12)]
x5 = 1:20
subX5 = x5[-(5:12)]
subX52 = x5[5:12]
unique(data1)
y = rnorm(10, 20, 3)
x1 = rnorm(10, 15, 6)
x2 = rnorm(10, 12, 4)
matY = matrix(y)
ones = rep(1, times = 10)
matX = matrix(c(ones, x1,x2), ncol = 3)
matXt = t(matX)
matXtX = matXt*matX
matXtX = matXt%*%matX
invmatXtX = solve(matXtX)
invmatXtX
matXtY = matXt%*%matY
beta = invmatXtX%*%matXtY
sMat = matrix(1:9, ncol = 3)
det(sMat)
solve(sMat)
u3 = diag(3)
nMat = cbind(sMat,u3)
nMat2 = rbind(sMat,u3)
 

 

If you find any advertisement showing some indecent material please report its web address (URL) on contact page. It will help us to block such websites to show their ads in future. Sorry for inconvenience.

   

 

f