R

@RDSharma

Binomial

R
4 years ago
n=8 p=0.4 X=0:8 pdf=dbinom(X,n, p) data.frame("X-values=",X,"probability",pdf) plot(X,pdf,type="h",main="Graph of pdf",xlab="X-value",ylab="probability",col="green") cdf=pbinom(X,n,p) data.frame("X-values",X, "cum probability",cdf)

PROBABILITY

R
4 years ago
#9.1 ns=52 na=26 pa=na/ns nb=4 pb=nb/ns nanb=2 panb=nanb/ns paub=pa+pb-panb cat(paub)

PRACTICAL 6

R
4 years ago
# coefficient of skewness for raw data x=c(56, 6,45,10,35,66,18,2,9,7,40,5) # skp me=mean(x) med=median(x) s=sd(x) skp=3*(me-med)/s cat("skp is ",skp, " ")

PRACTICAL 3

R
4 years ago
# histogram for raw data x=c(10, 51,34,68,29,12,15,84,78,73,94,97,25,66,10,3,5,8,48,39) hist(x,breaks=5,xlab="marks by students",ylab="Nos of students",main="histogram for raw data") #color histogram for group data lb=seq(15,45,5) ub=seq(20,50,5) hist_x=(lb+ub) /2 #lb+ub in bracket if not then wrong histogram

Practical 3

R
4 years ago
#R command for histogram raw data

Practical2

R
4 years ago
x=c(7, 7,3,4,5,6,6,5,4,7) table(x)#output 1st row x value 2nd row frequency #if want table in vertical then transform(table(x)) #output 1st column serial no 2nd x value 3rd frequency x=c(20,25, 30,35,40,45) f=c(5, 3,11,2,9,15) data.frame(x,f)#no name to columns #if want to give name to columns then

Pie chart

R
4 years ago
pie_l=c("Rent",'food', 'clothing', 'education', 'savings') pie_x=c(4000, 5400,2800,1800,400) pie(pie_x,pie_l) line_x=c(50,30,40,30,20,50) plot(line_x,type='o',xlab="Months",ylab="Nos of bicyle sold",col="cyan") points(line_x,pch=16) bar_x=c(100, 200,85,90) bar_l=c("Cricket","football","Tennis","Chess")

Re

SQL
4 years ago
create table Employee(Empno integer(3) primary key,Ename varchar(20) not null, Designation varchar(20),Deptno integer(3)); insert into Employee values(111, "Rajesh","Salesman",203); insert into Employee values(241, 'Poonam',"Analyst",104 ); insert into Employee values(222, 'Rishi','President', 111); delete from Employee where Deptno=111; select * from Employee;

Sql

SQL
4 years ago
create table Employee(Empno integer(3) primary key,Ename varchar(20) not null, Designation varchar(20),Deptno integer(3)); select * from Employee;

Database join views, dcl commands

SQL
4 years ago
create table book(bid int, bname varchar(25),author varchar(20),price decimal (6,2),catid int); insert into book values(1,"Programming in C","balaguruswamy",350,11); insert into book values(2,"Digital Electronics","Floyd",480,12); insert into book values(3, "Great expectation","Charles Dickens",300,14); insert into book values(4, "Wings of fire","APJ Abdul kalam",550,16); select * from book; create table category(cid int, description varchar(25));

Probability

R
4 years ago
# r command for conditional probability of an event ns1=52 na=13 ns2=51 nb=12 p=(na/ns1)*(nb/ns2)

Regression

R
4 years ago
# r command for regression x=c(2005, 2006,2007,2008,2009,2010) y=c(12, 19,29,37,45,54) yx=lm(y~x) xy=lm(x~y) print(yx)

Correlation

R
4 years ago
# R command for computing karl pearson and Spearman coefficient x=c(15,16, 19,17,17,15,18,16,18,18) y=c(10, 12,12,13,11,9,11,13,11,12) r=cor(x, y,method="pearson")# can mention method if you like but by default cor do karl pearson R=cor(x, y, method="spearman") cat('karl pearson coefficient=',r) cat('\nSpearman=',R)