Multiple Response Data Analysis
“Femmes.xlsx dataset consists responses from women aged 15–49 living in the households. There are three variable that can be considered as multiple response. The question were:
Question: From which media you get news?
|
journal |
Read Newspaper 0=No, 1=Yes |
|
Radio |
Hear Radio 0=No, 1=Yes |
|
TV |
Watch Television 0=No, 1=Yes |
//install.packages("expss")
library(expss)
df=apply_labels(df,
journal="Read Newspaper",
journal=c( "No"=0, "Yes"=1),
radio="Hear Radio",
radio=c( "No"=0, "Yes"=1),
tv="Watch Television",
tv=c( "No"=0, "Yes"=1)
)
The first respondent didn’t respond, second respondent selected only radio, 6th respondent selected radio and TV.
To find simple frequencies:
# install.packages("dplyr")
library(dplyr)
count(df, radio, name = "Freq") %>% mutate(Percent = round(Freq/sum(Freq)*100, 1))
or
cbind(table(data$radio),round(prop.table(table(data$radio))*100,1))
n=nrow(df)
counts=colSums(df[,8:10])
percent <- round((counts / n) * 100, 2)
result <- data.frame(
Selected = counts,
Percent = percent
)
print(result)
No More
No More
Statlearner
Statlearner