Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.5 kB
2
Indexable
Never
data_set$Gender=factor(experiment_2_data_set$Gender,labels=c("male","female"))
experiment_2_data_set$Gender
experiment_2_data_set$Married=factor(experiment_2_data_set$Married,labels = c("yes","no"))
experiment_2_data_set$Married
experiment_2_data_set$ChildC=factor(experiment_2_data_set$ChildC,labels = c("one","two","three"))
experiment_2_data_set$ChildC
experiment_2_data_set$Smoke=factor(experiment_2_data_set$Smoke,labels = c("yes","no"))
experiment_2_data_set$Smoke
experiment_2_data_set$Finish=factor(experiment_2_data_set$Finish,labels = c("yes","no"))
experiment_2_data_set$Finish
male=subset(experiment_2_data_set,experiment_2_data_set$Gender=="male")
male
female=subset(experiment_2_data_set,experiment_2_data_set$Gender=="female")
female
summary(experiment_2_data_set)
summary(male)
summary(female)
table1=table(experiment_2_data_set$Gender)
table1
table2=table(experiment_2_data_set$Married)
table3=table(experiment_2_data_set$ChildC)
table4=table(experiment_2_data_set$Smoke)
table5=table(experiment_2_data_set$Finish)
table2
table3
table4
table5
pie(table1)
plot(density(table1))
hist(table1,main="histogram of gender",xlab="x axis",ylab="y axis",col="blue")
plot(table1,type="o",pch=22,lty=2,col="red")
plot(male,female)
boxplot(table1)
barplot(table1)
plot(experiment_2_data_set$Age,type="l",main="age of subjects",xlab="x axis",ylab = "y axis",col="blue")
legend("topright",legend=rownames(table1),fill=c('blue','red'),bty="n")
Leave a Comment