# Input library


library(tidyverse)   # to tidy and wrangle data
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5     v purrr   0.3.4
## v tibble  3.1.6     v dplyr   1.0.7
## v tidyr   1.1.4     v stringr 1.4.0
## v readr   2.1.0     v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(readxl)     # to read Excel data
library(janitor)    # to clean variable names
## 
## 载入程辑包:'janitor'
## The following objects are masked from 'package:stats':
## 
##     chisq.test, fisher.test
library(hablar)     # to convert data type
## 
## 载入程辑包:'hablar'
## The following object is masked from 'package:dplyr':
## 
##     na_if
## The following object is masked from 'package:tibble':
## 
##     num
library(ggplot2)    # to plot visualization
library(gtsummary)  # to create descriptive summary table
library(foreign)    # to read SPSS sav file
library(huxtable)
## 
## 载入程辑包:'huxtable'
## The following object is masked from 'package:gtsummary':
## 
##     as_flextable
## The following object is masked from 'package:dplyr':
## 
##     add_rownames
## The following object is masked from 'package:ggplot2':
## 
##     theme_grey
library(dplyr)     #to recode likert scale.
# in the library(readxl), read_xlsx can read Excel files into R.

OCC <- read_xlsx("data/data.xlsx") %>% clean_names() 
## Warning in FUN(X[[i]], ...): strings not representable in native encoding will
## be translated to UTF-8
## Warning in FUN(X[[i]], ...): unable to translate '<U+00C4>' to native encoding
## Warning in FUN(X[[i]], ...): unable to translate '<U+00D6>' to native encoding
## Warning in FUN(X[[i]], ...): unable to translate '<U+00E4>' to native encoding
## Warning in FUN(X[[i]], ...): unable to translate '<U+00F6>' to native encoding
## Warning in FUN(X[[i]], ...): unable to translate '<U+00DF>' to native encoding
## Warning in FUN(X[[i]], ...): unable to translate '<U+00C6>' to native encoding
## Warning in FUN(X[[i]], ...): unable to translate '<U+00E6>' to native encoding
## Warning in FUN(X[[i]], ...): unable to translate '<U+00D8>' to native encoding
## Warning in FUN(X[[i]], ...): unable to translate '<U+00F8>' to native encoding
## Warning in FUN(X[[i]], ...): unable to translate '<U+00C5>' to native encoding
## Warning in FUN(X[[i]], ...): unable to translate '<U+00E5>' to native encoding
view(OCC)
#summary(OCC)
#glimpse(OCC)

#Demgrophic Table

# Demographic
OCC <- OCC %>% 
  convert(
    fct(a1),fct(a3),fct(a4_2),fct(a4_3),fct(a4_4)
          )

OCC_dem <- OCC  %>% 
   select(a1,a2_1_text,a3,a4_1,a4_2 ,a4_3,a4_4)
# Rename a variable

OCC_dem_1 <- OCC_dem %>%
  mutate(Gender = a1,
         Age=a2_1_text,
         Education_Level = a3,
         Working_Experience = a4_1,
         Working_Setting =a4_2,
         Nature_of_Working_Place = a4_3,
         Client = a4_4
         )  # new name first, follow by old name

OCC_dem_1 <- OCC_dem_1  %>% 
   select(Gender,
          Age,
         Education_Level ,
         Working_Experience,
         Working_Setting ,
         Nature_of_Working_Place,
         Client )


summary(OCC_dem_1
        )
##     Gender       Age              Education_Level Working_Experience
##  Female:5   Min.   :24   Bachelor’s degree:5      Min.   : 1.000    
##  Male  :2   1st Qu.:24   Doctoral Degree  :1      1st Qu.: 1.000    
##             Median :24   Master’s degree  :1      Median : 1.000    
##             Mean   :32                            Mean   : 7.429    
##             3rd Qu.:36                            3rd Qu.:10.000    
##             Max.   :48                            Max.   :28.000    
##             NA's   :4                                               
##                    Working_Setting       Nature_of_Working_Place
##  Acute                     :1      Private healthcare:1         
##  Aged Care                 :2      Private Practice  :3         
##  Aged Care,Home Health Care:1      Public healthcare :3         
##  Community Based           :1                                   
##  Long Term Care            :1                                   
##  Rehabilitation            :1                                   
##                                                                 
##                  Client 
##  Adolescents        :1  
##  Adults             :3  
##  Adults,Older Adults:1  
##  Children           :1  
##  Older Adults       :1  
##                         
## 
tb1_OCC <- OCC_dem_1 %>%
  tbl_summary(
    missing = "no",
     type = list(c(Working_Experience) ~ "continuous2", Gender ~ "categorical"),
    statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)")
    )%>%
  

  
  bold_labels %>%
   add_n() %>%
  modify_header (label="**Demographic**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 2:Summary of Participants Demographic Information in Survey") %>%
  as_hux_table()

tb1_OCC
Table 2:Summary of Participants Demographic Information in Survey

Frequency

Demographic

N

N = 7

Gender7
Female5 (71%)
Male2 (29%)
Age3
242 (67%)
481 (33%)
Education_Level7
Bachelor’s degree5 (71%)
Doctoral Degree1 (14%)
Master’s degree1 (14%)
Working_Experience7
Mean (SD)7 (10)
Working_Setting7
Acute1 (14%)
Aged Care2 (29%)
Aged Care,Home Health Care1 (14%)
Community Based1 (14%)
Long Term Care1 (14%)
Rehabilitation1 (14%)
Nature_of_Working_Place7
Private healthcare1 (14%)
Private Practice3 (43%)
Public healthcare3 (43%)
Client7
Adolescents1 (14%)
Adults3 (43%)
Adults,Older Adults1 (14%)
Children1 (14%)
Older Adults1 (14%)

#Easy to use Question 5

#Easy to use from a5_1,   a5_2,    a5_3

# Rename a variable
OCC_easy_to_use <- OCC %>%
  mutate(Minimal_Assistance = a5_1,
        Moderate_Assistance=a5_2,
         Total_Dependence = a5_3
         )  # new name first, follow by old name

OCC_easy_to_use_1 <- OCC_easy_to_use %>% 
   select(Minimal_Assistance,
        Moderate_Assistance,
         Total_Dependence)


glimpse(OCC_easy_to_use_1
        )
## Rows: 7
## Columns: 3
## $ Minimal_Assistance  <chr> "Very difficult", "Very difficult", "Difficult", "~
## $ Moderate_Assistance <chr> "Very difficult", "Very difficult", "Very difficul~
## $ Total_Dependence    <chr> "Very difficult", "Very difficult", "Very difficul~
tb1_easy_to_use <- OCC_easy_to_use_1 %>%
  tbl_summary(
    missing = "no"
    )%>%
  

  
  bold_labels %>%

  modify_header (label="**Easty to Use**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 3:Easy to Use of Soft Service Robot") %>%
  as_hux_table()

tb1_easy_to_use
Table 3:Easy to Use of Soft Service Robot

Frequency

Easty to Use

N = 7

Minimal_Assistance
Difficult1 (14%)
Easy1 (14%)
Somewhat difficult1 (14%)
Somewhat easy1 (14%)
Very difficult3 (43%)
Moderate_Assistance
Somewhat difficult3 (43%)
Very difficult4 (57%)
Total_Dependence
Difficult3 (43%)
Very difficult4 (57%)
n (%)
#Recoding the values for likert scale questions
OCC_easy_to_use_1_recoded <- OCC_easy_to_use_1 %>% mutate_at(c("Minimal_Assistance","Moderate_Assistance", "Total_Dependence"), funs(recode(.,"Very difficult"=1,"Difficult"=2,"Somewhat difficult"=3,"Neither easy nor difficult"=4,"Somewhat easy"=5,"Easy"=6,"Very easy"=7)))
## Warning: `funs()` was deprecated in dplyr 0.8.0.
## Please use a list of either functions or lambdas: 
## 
##   # Simple named list: 
##   list(mean = mean, median = median)
## 
##   # Auto named with `tibble::lst()`: 
##   tibble::lst(mean, median)
## 
##   # Using lambdas
##   list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
#view(OCC_easy_to_use_1_recoded)         To comfirm whether it is recoded


#To analyse easy to use
tb1_easy_to_use <- OCC_easy_to_use_1_recoded  %>%
  tbl_summary(
    missing = "no",
    type = list(c(Minimal_Assistance ,Moderate_Assistance, Total_Dependence) ~ "continuous2"),
    statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)")
    )%>%
  

  
  bold_labels %>%
  add_n() %>%
    modify_header (label="**Easy to Use**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 4: Easy to Use of Soft Service Robot_Analysis") %>%
  as_hux_table()

tb1_easy_to_use
Table 4: Easy to Use of Soft Service Robot_Analysis

Frequency

Easy to Use

N

N = 7

Minimal_Assistance7
Mean (SD)2.71 (2.06)
Moderate_Assistance7
Mean (SD)1.86 (1.07)
Total_Dependence7
Mean (SD)1.43 (0.53)

#USEFUL Question 6

#Useful from a6_1,   a6_2,    a6_3

# Rename a variable

OCC_useful <- OCC %>%
  mutate(Minimal_Assistance = a6_1,
        Moderate_Assistance=a6_2,
         Total_Dependence = a6_3
         )  # new name first, follow by old name

OCC_useful_1 <- OCC_useful %>% 
   select(Minimal_Assistance,
        Moderate_Assistance,
         Total_Dependence)


glimpse(OCC_useful_1
        )
## Rows: 7
## Columns: 3
## $ Minimal_Assistance  <chr> "Very not useful", "Very not useful", "Useful", "N~
## $ Moderate_Assistance <chr> "Very not useful", "Very not useful", "Useful", "V~
## $ Total_Dependence    <chr> "Very not useful", "Very not useful", "Very useful~
tb1_useful<- OCC_useful_1 %>%
  tbl_summary(
    missing = "no"
    )%>%
  

  
  bold_labels %>%

  modify_header (label="**Useful**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 5: Useful of Soft Service Robot") %>%
  as_hux_table()

tb1_useful
Table 5: Useful of Soft Service Robot

Frequency

Useful

N = 7

Minimal_Assistance
Not useful1 (14%)
Somewhat useful1 (14%)
Useful1 (14%)
Very not useful2 (29%)
Very useful2 (29%)
Moderate_Assistance
Useful2 (29%)
Very not useful3 (43%)
Very useful2 (29%)
Total_Dependence
Neither useful nor not useful1 (14%)
Very not useful2 (29%)
Very useful4 (57%)
n (%)
#Recoding the values for likert scale questions
OCC_useful_1_recoded <- OCC_useful_1 %>% mutate_at(c("Minimal_Assistance","Moderate_Assistance", "Total_Dependence"), funs(recode(.,"Very not useful"=1,"Not useful"=2,"Somewhat not useful"=3,"Neither useful nor not useful"=4,"Somewhat useful"=5,"Useful"=6,"Very useful"=7)))


#view(OCC_easy_to_use_1_recoded)         To comfirm whether it is recoded


#To analyse easy to use
tb1_useful <- OCC_useful_1_recoded  %>%
  tbl_summary(
    missing = "no",
    type = list(c(Minimal_Assistance ,Moderate_Assistance, Total_Dependence) ~ "continuous2"),
    statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)")
    )%>%
  

  
  bold_labels %>%
  add_n() %>%
    modify_header (label="**Useful**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 6: Useful of Soft Service Robot_Analysis") %>%
  as_hux_table()

tb1_useful
Table 6: Useful of Soft Service Robot_Analysis

Frequency

Useful

N

N = 7

Minimal_Assistance7
Mean (SD)4.14 (2.73)
Moderate_Assistance7
Mean (SD)4.14 (2.97)
Total_Dependence7
Mean (SD)4.86 (2.85)

Consider to purchase

#Consider to purchase from a7_1,   a7_2,    a7_3

# Rename a variable

OCC_consider_to_purchase<- OCC %>%
  mutate(Minimal_Assistance = a7_1,
        Moderate_Assistance=a7_2,
         Total_Dependence = a7_3
         )  # new name first, follow by old name

OCC_consider_to_purchase_1<- OCC_consider_to_purchase %>% 
   select(Minimal_Assistance,
        Moderate_Assistance,
         Total_Dependence)


glimpse(OCC_consider_to_purchase_1
        )
## Rows: 7
## Columns: 3
## $ Minimal_Assistance  <chr> "Very unlikely to purchase", "Very unlikely to pur~
## $ Moderate_Assistance <chr> "Unlikely to purchase", "Very unlikely to purchase~
## $ Total_Dependence    <chr> "Very unlikely to purchase", "Very unlikely to pur~
#Prepare table

tb1_consider_to_purchase<- OCC_consider_to_purchase_1 %>%
  tbl_summary(
    missing = "no"
    )%>%
  

  
  bold_labels %>%

  modify_header (label="**Consider to purchase**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 7: Consider to purchase the Soft Service Robot") %>%
  as_hux_table()

tb1_consider_to_purchase
Table 7: Consider to purchase the Soft Service Robot

Frequency

Consider to purchase

N = 7

Minimal_Assistance
Likely to purchase1 (14%)
Somewhat likely to purchase2 (29%)
Unlikely to purchase1 (14%)
Very unlikely to purchase3 (43%)
Moderate_Assistance
Likely to purchase2 (29%)
Unlikely to purchase1 (14%)
Very likely to purchase1 (14%)
Very unlikely to purchase3 (43%)
Total_Dependence
Unlikely to purchase1 (14%)
Very likely to purchase3 (43%)
Very unlikely to purchase3 (43%)
n (%)
#Recoding the values for likert scale questions
OCC_consider_to_purchase_1_recoded <- OCC_consider_to_purchase_1 %>% mutate_at(c("Minimal_Assistance","Moderate_Assistance", "Total_Dependence"), funs(recode(.,"Very unlikely to purchase"=1,"Unlikely to purchase"=2,"Somewhat unlikely to purchase"=3,"Neither likely nor unlikely to purchase"=4,"Somewhat likely to purchase"=5,"Likely to purchase"=6,"Very likely to purchase"=7)))


#view(OCC_consider_to_purchase_1_recoded)         To comfirm whether it is recoded


#To analyse easy to use
tb1_consider_to_purchase <- OCC_consider_to_purchase_1_recoded  %>%
  tbl_summary(
    missing = "no",
    type = list(c(Minimal_Assistance ,Moderate_Assistance, Total_Dependence) ~ "continuous2"),
    statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)")
    )%>%
  

  
  bold_labels %>%
  add_n() %>%
    modify_header (label="**Consider to Purchase**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 8: Consider to purchase the Soft Service Robot_Analysis") %>%
  as_hux_table()

tb1_consider_to_purchase
Table 8: Consider to purchase the Soft Service Robot_Analysis

Frequency

Consider to Purchase

N

N = 7

Minimal_Assistance7
Mean (SD)3.00 (2.24)
Moderate_Assistance7
Mean (SD)3.43 (2.76)
Total_Dependence7
Mean (SD)3.71 (3.09)

#B1 how vivid do you feel your imaginative experience was?

#vivid of imaginative experience

# Rename a variable

OCC_vivid_imaginative_experience <- OCC %>%
  mutate(Vivid_of_imaginative_experience= b1
         )  # new name first, follow by old name

OCC_vivid_imaginative_experience_1<- OCC_vivid_imaginative_experience %>% 
   select(Vivid_of_imaginative_experience)


glimpse(OCC_vivid_imaginative_experience_1
        )
## Rows: 7
## Columns: 1
## $ Vivid_of_imaginative_experience <chr> NA, "3. Slightly vague and dim", "3. S~
#Prepare table

tb1_vivid_imaginative_experience<- OCC_vivid_imaginative_experience_1 %>%
  tbl_summary(
    missing = "always",
    
        statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)") )%>%
  

  
  bold_labels %>%

  modify_header (label="**Vivid of imaginative experience**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 9: The vivid of imaginative experience") %>%
  as_hux_table()

tb1_vivid_imaginative_experience
Table 9: The vivid of imaginative experience

Frequency

Vivid of imaginative experience

N = 7

Vivid_of_imaginative_experience
3. Slightly vague and dim2 (33%)
5. Slightly clear and vivid1 (17%)
6. Moderately clear and reasonably vivid1 (17%)
7. Perfectly clear and vivid2 (33%)
Unknown1
n (%)
#Recoding the values for likert scale questions
OCC_vivid_imaginative_experience_1_recoded <- OCC_vivid_imaginative_experience_1 %>% mutate_at(c("Vivid_of_imaginative_experience"), funs(recode(.,"1.  No image at all, you only'know' that you are thinking of the hair"=1,"2.  Moderately vague and dim"=2,"3. Slightly vague and dim"=3,"4.Netural"=4,"5. Slightly clear and vivid"=5,"6. Moderately clear and reasonably vivid"=6,"7. Perfectly clear and vivid"=7)))


#view(OCC_vivid_imaginative_experience_1_recoded)         To comfirm whether it is recoded


#To analyse vivid_imaginative_experience
tb1_vivid_imaginative_experience <- OCC_vivid_imaginative_experience_1_recoded  %>%
  tbl_summary(
    missing = "always",
      type = list(c(Vivid_of_imaginative_experience) ~ "continuous2"),
    statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)")
    )%>%
  

  
  bold_labels %>%
  add_n() %>%
    modify_header (label="**Vivid of imaginative experience**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 10: The vivid of imaginative experience_Analysis") %>%
  as_hux_table()

tb1_vivid_imaginative_experience
Table 10: The vivid of imaginative experience_Analysis

Frequency

Vivid of imaginative experience

N

N = 7

Vivid_of_imaginative_experience6
Mean (SD)5.17 (1.83)
Unknown1

Power of mental imagery B2

#power of mental imagery

# Rename a variable

OCC_power_of_mental_imagery <- OCC %>%
  mutate(power_of_mental_imagery= b2
         )  # new name first, follow by old name

OCC_power_of_mental_imagery_1<- OCC_power_of_mental_imagery %>% 
   select(power_of_mental_imagery)


glimpse(OCC_power_of_mental_imagery_1
        )
## Rows: 7
## Columns: 1
## $ power_of_mental_imagery <chr> NA, "7. Excellent", "7. Excellent", "3. Fairly~
#Prepare table

tb1_power_of_mental_imagery<- OCC_power_of_mental_imagery_1 %>%
  tbl_summary(
    missing = "always",
    
        statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)") )%>%
  

  
  bold_labels %>%

  modify_header (label="**power_of_mental_imagery**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 11: The power_of_mental_imagery") %>%
  as_hux_table()

tb1_power_of_mental_imagery
Table 11: The power_of_mental_imagery

Frequency

power_of_mental_imagery

N = 7

power_of_mental_imagery
3. Fairly poor1 (17%)
5. Fairly good2 (33%)
6. Good1 (17%)
7. Excellent2 (33%)
Unknown1
n (%)
#Recoding the values for likert scale questions
OCC_power_of_mental_imagery_1_recoded <- OCC_power_of_mental_imagery_1 %>% mutate_at(c("power_of_mental_imagery"), funs(recode(.,"1.Very poor"=1,"2.Poor"=2,"3. Fairly poor"=3,"4. Average"=4,"5. Fairly good"=5,"6. Good"=6,"7. Excellent"=7)))


#view(OCC_power_of_mental_imagery_1_recoded )         To confirm whether it is recoded


#To analyse vivid_imaginative_experience
tb1_power_of_mental_imagery <- OCC_power_of_mental_imagery_1_recoded   %>%
  tbl_summary(
    missing = "always",
      type = list(c(power_of_mental_imagery) ~ "continuous2"),
    statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)")
    )%>%
  

  
  bold_labels %>%
  add_n() %>%
    modify_header (label="**power_of_mental_imagery**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 12: The power_of_mental_imagery_Analysis") %>%
  as_hux_table()

tb1_power_of_mental_imagery
Table 12: The power_of_mental_imagery_Analysis

Frequency

power_of_mental_imagery

N

N = 7

power_of_mental_imagery6
Mean (SD)5.50 (1.52)
Unknown1

C1 Perceived usability

#Perceived usability—the

# Rename a variable

OCC_perceived_usability <- OCC %>%
  mutate(I_think_the_softservice_robot_would_be_userfriendly= c1_1,
         I_think_the_softservice_robot_would_be_practicalto_use_in_clients_homes = c1_2,
         I_am_satisfied_with_the_observed_performance_of_the_soft_service_robot=c1_3,
         I_am_satisfied_with_the_observed_usability_of_the_softservice_robot=c1_4
         )  # new name first, follow by old name

OCC_perceived_usability_1<- OCC_perceived_usability %>% 
   select(I_think_the_softservice_robot_would_be_userfriendly,
         I_think_the_softservice_robot_would_be_practicalto_use_in_clients_homes,
         I_am_satisfied_with_the_observed_performance_of_the_soft_service_robot,
         I_am_satisfied_with_the_observed_usability_of_the_softservice_robot)


glimpse(OCC_perceived_usability_1
        )
## Rows: 7
## Columns: 4
## $ I_think_the_softservice_robot_would_be_userfriendly                     <chr> ~
## $ I_think_the_softservice_robot_would_be_practicalto_use_in_clients_homes <chr> ~
## $ I_am_satisfied_with_the_observed_performance_of_the_soft_service_robot  <chr> ~
## $ I_am_satisfied_with_the_observed_usability_of_the_softservice_robot     <chr> ~
#Prepare table

tb1_perceived_usability<- OCC_perceived_usability_1 %>%
  tbl_summary(
    missing = "always",
    
        statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)") )%>%
  

  
  bold_labels %>%

  modify_header (label="**perceived_usability**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 13: perceived_usability") %>%
  as_hux_table()

tb1_perceived_usability
Table 13: perceived_usability

Frequency

perceived_usability

N = 7

I_think_the_softservice_robot_would_be_userfriendly
Neither agree nor disagree1 (17%)
Somewhat agree3 (50%)
Strongly disagree2 (33%)
Unknown1
I_think_the_softservice_robot_would_be_practicalto_use_in_clients_homes
Disagree1 (17%)
Neither agree nor disagree1 (17%)
Somewhat agree3 (50%)
Strongly disagree1 (17%)
Unknown1
I_am_satisfied_with_the_observed_performance_of_the_soft_service_robot
Agree1 (17%)
Disagree1 (17%)
Somewhat agree2 (33%)
Strongly agree1 (17%)
Strongly disagree1 (17%)
Unknown1
I_am_satisfied_with_the_observed_usability_of_the_softservice_robot
Agree1 (17%)
Neither agree nor disagree1 (17%)
Somewhat agree3 (50%)
Strongly disagree1 (17%)
Unknown1
n (%)
#Recoding the values for likert scale questions
OCC_perceived_usability_1_recoded <- OCC_perceived_usability_1 %>% mutate_at(c("I_think_the_softservice_robot_would_be_userfriendly",
         "I_think_the_softservice_robot_would_be_practicalto_use_in_clients_homes",
         "I_am_satisfied_with_the_observed_performance_of_the_soft_service_robot",
         "I_am_satisfied_with_the_observed_usability_of_the_softservice_robot"), funs(recode(.,"Strongly disagree"=1,"Disagree"=2,"Somewhat disagree"=3,"Neither agree nor disagree"=4,"Somewhat agree"=5,"Agree"=6,"Strongly agree"=7)))


#view(OCC_perceived_usability_1_recoded)         To confirm whether it is recoded


#To analyse vivid_imaginative_experience
tb1_perceived_usability <- OCC_perceived_usability_1_recoded   %>%
  tbl_summary(
    missing = "always",
      type = list(c(I_think_the_softservice_robot_would_be_userfriendly,
         I_think_the_softservice_robot_would_be_practicalto_use_in_clients_homes,
         I_am_satisfied_with_the_observed_performance_of_the_soft_service_robot,
         I_am_satisfied_with_the_observed_usability_of_the_softservice_robot) ~ "continuous2"),
    statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)")
    )%>%
  

  
  bold_labels %>%
  add_n() %>%
    modify_header (label="**perceived_usability**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 14. perceived_usability_Analysis") %>%
  as_hux_table()

tb1_perceived_usability 
Table 14. perceived_usability_Analysis

Frequency

perceived_usability

N

N = 7

I_think_the_softservice_robot_would_be_userfriendly6
Mean (SD)3.50 (1.97)
Unknown1
I_think_the_softservice_robot_would_be_practicalto_use_in_clients_homes6
Mean (SD)3.67 (1.75)
Unknown1
I_am_satisfied_with_the_observed_performance_of_the_soft_service_robot6
Mean (SD)4.33 (2.34)
Unknown1
I_am_satisfied_with_the_observed_usability_of_the_softservice_robot6
Mean (SD)4.33 (1.75)
Unknown1

Try C2-C12

#Select data from C2-C12

OCC_C2_to_C12<- OCC %>% 
   select(c2_1,c2_2,c2_3,c2_4,c2_5,c3_1,c3_2,c3_3,c4_1,c4_2,c4_3,c5_1,c5_2,c5_3,c6_1,c6_2,c6_3,c6_4,c7_1,c7_2,c7_3,c8_1,c9_1,c9_2,c9_3,c10_1,c10_2,c10_3,c11_1,c11_2,c11_3,c12_1,c12_2,c12_3)


glimpse(OCC_C2_to_C12
        )
## Rows: 7
## Columns: 34
## $ c2_1  <chr> NA, "Disagree", "Neither agree nor disagree", "Disagree", "Somew~
## $ c2_2  <chr> NA, "Disagree", "Neither agree nor disagree", "Disagree", "Somew~
## $ c2_3  <chr> NA, "Disagree", "Neither agree nor disagree", "Somewhat disagree~
## $ c2_4  <chr> NA, "Strongly disagree", "Neither agree nor disagree", "Disagree~
## $ c2_5  <chr> NA, "Somewhat disagree", "Neither agree nor disagree", "Neither ~
## $ c3_1  <chr> NA, "Neither agree nor disagree", "Strongly disagree", "Disagree~
## $ c3_2  <chr> NA, "Agree", "Strongly disagree", "Disagree", "Somewhat agree", ~
## $ c3_3  <chr> NA, "Somewhat disagree", "Strongly disagree", "Somewhat agree", ~
## $ c4_1  <chr> NA, "Strongly disagree", "Strongly disagree", "Strongly disagree~
## $ c4_2  <chr> NA, "Disagree", "Strongly disagree", "Strongly disagree", "Somew~
## $ c4_3  <chr> NA, "Somewhat disagree", "Strongly disagree", "Strongly disagree~
## $ c5_1  <chr> NA, "Strongly disagree", "Disagree", "Neither agree nor disagree~
## $ c5_2  <chr> NA, "Strongly disagree", "Disagree", "Strongly disagree", "Somew~
## $ c5_3  <chr> NA, "Strongly disagree", "Disagree", "Strongly agree", "Somewhat~
## $ c6_1  <chr> NA, "Strongly disagree", "Strongly disagree", "Somewhat disagree~
## $ c6_2  <chr> NA, "Strongly disagree", "Strongly disagree", "Disagree", "Somew~
## $ c6_3  <chr> NA, "Strongly disagree", "Strongly disagree", "Strongly disagree~
## $ c6_4  <chr> NA, "Strongly disagree", "Strongly disagree", "Somewhat disagree~
## $ c7_1  <chr> NA, "Disagree", "Strongly disagree", "Disagree", "Somewhat agree~
## $ c7_2  <chr> NA, "Disagree", "Strongly disagree", "Disagree", "Somewhat agree~
## $ c7_3  <chr> NA, "Disagree", "Strongly disagree", "Somewhat disagree", "Somew~
## $ c8_1  <chr> NA, "Strongly disagree", "Strongly disagree", "Strongly disagree~
## $ c9_1  <chr> NA, "Disagree", "Strongly disagree", NA, NA, "Agree", "Somewhat ~
## $ c9_2  <chr> NA, "Strongly disagree", "Strongly disagree", NA, NA, "Agree", "~
## $ c9_3  <chr> NA, "Somewhat agree", "Strongly disagree", NA, NA, "Agree", "Som~
## $ c10_1 <chr> NA, "Strongly disagree", "Strongly disagree", "Neither agree nor~
## $ c10_2 <chr> NA, "Strongly disagree", "Strongly disagree", "Neither agree nor~
## $ c10_3 <chr> NA, "Strongly disagree", "Strongly disagree", "Somewhat agree", ~
## $ c11_1 <chr> NA, "Strongly disagree", "Strongly disagree", "Neither agree nor~
## $ c11_2 <chr> NA, "Disagree", "Strongly disagree", "Somewhat disagree", "Somew~
## $ c11_3 <chr> NA, "Disagree", "Strongly disagree", "Neither agree nor disagree~
## $ c12_1 <chr> NA, "Strongly disagree", "Strongly disagree", "Somewhat disagree~
## $ c12_2 <chr> NA, "Strongly disagree", "Strongly disagree", "Disagree", "Somew~
## $ c12_3 <chr> NA, "Strongly disagree", "Strongly disagree", "Neither agree nor~
#Prepare table

tb1_C2_to_C12<- OCC_C2_to_C12 %>%
  tbl_summary(
    missing = "always",
    
        statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)") )%>%
  

  
  bold_labels %>%

  modify_header (label="**C2-C12**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 15: perceived_usability") %>%
  as_hux_table()

tb1_C2_to_C12
Table 15: perceived_usability

Frequency

C2-C12

N = 7

c2_1
Disagree2 (33%)
Neither agree nor disagree1 (17%)
Somewhat agree3 (50%)
Unknown1
c2_2
Disagree2 (40%)
Neither agree nor disagree1 (20%)
Somewhat agree2 (40%)
Unknown2
c2_3
Disagree1 (20%)
Neither agree nor disagree1 (20%)
Somewhat agree2 (40%)
Somewhat disagree1 (20%)
Unknown2
c2_4
Disagree1 (20%)
Neither agree nor disagree1 (20%)
Somewhat agree2 (40%)
Strongly disagree1 (20%)
Unknown2
c2_5
Neither agree nor disagree2 (40%)
Somewhat agree2 (40%)
Somewhat disagree1 (20%)
Unknown2
c3_1
Agree1 (17%)
Disagree1 (17%)
Neither agree nor disagree1 (17%)
Somewhat agree2 (33%)
Strongly disagree1 (17%)
Unknown1
c3_2
Agree2 (33%)
Disagree1 (17%)
Somewhat agree2 (33%)
Strongly disagree1 (17%)
Unknown1
c3_3
Agree1 (17%)
Somewhat agree3 (50%)
Somewhat disagree1 (17%)
Strongly disagree1 (17%)
Unknown1
c4_1
Neither agree nor disagree1 (17%)
Somewhat agree2 (33%)
Strongly disagree3 (50%)
Unknown1
c4_2
Agree1 (17%)
Disagree1 (17%)
Somewhat agree2 (33%)
Strongly disagree2 (33%)
Unknown1
c4_3
Agree1 (17%)
Neither agree nor disagree1 (17%)
Somewhat agree1 (17%)
Somewhat disagree1 (17%)
Strongly disagree2 (33%)
Unknown1
c5_1
Agree1 (17%)
Disagree1 (17%)
Neither agree nor disagree1 (17%)
Somewhat agree2 (33%)
Strongly disagree1 (17%)
Unknown1
c5_2
Agree1 (17%)
Disagree1 (17%)
Somewhat agree2 (33%)
Strongly disagree2 (33%)
Unknown1
c5_3
Agree1 (17%)
Disagree1 (17%)
Somewhat agree2 (33%)
Strongly agree1 (17%)
Strongly disagree1 (17%)
Unknown1
c6_1
Somewhat agree3 (50%)
Somewhat disagree1 (17%)
Strongly disagree2 (33%)
Unknown1
c6_2
Disagree1 (17%)
Somewhat agree3 (50%)
Strongly disagree2 (33%)
Unknown1
c6_3
Somewhat agree3 (50%)
Strongly disagree3 (50%)
Unknown1
c6_4
Neither agree nor disagree1 (17%)
Somewhat agree1 (17%)
Somewhat disagree2 (33%)
Strongly disagree2 (33%)
Unknown1
c7_1
Agree1 (17%)
Disagree2 (33%)
Somewhat agree2 (33%)
Strongly disagree1 (17%)
Unknown1
c7_2
Agree1 (17%)
Disagree2 (33%)
Somewhat agree2 (33%)
Strongly disagree1 (17%)
Unknown1
c7_3
Agree1 (17%)
Disagree1 (17%)
Somewhat agree2 (33%)
Somewhat disagree1 (17%)
Strongly disagree1 (17%)
Unknown1
c8_1
Agree1 (17%)
Somewhat agree2 (33%)
Strongly disagree3 (50%)
Unknown1
c9_1
Agree1 (25%)
Disagree1 (25%)
Somewhat agree1 (25%)
Strongly disagree1 (25%)
Unknown3
c9_2
Agree1 (25%)
Somewhat agree1 (25%)
Strongly disagree2 (50%)
Unknown3
c9_3
Agree1 (25%)
Somewhat agree2 (50%)
Strongly disagree1 (25%)
Unknown3
c10_1
Neither agree nor disagree1 (17%)
Somewhat agree3 (50%)
Strongly disagree2 (33%)
Unknown1
c10_2
Neither agree nor disagree1 (17%)
Somewhat agree3 (50%)
Strongly disagree2 (33%)
Unknown1
c10_3
Somewhat agree4 (67%)
Strongly disagree2 (33%)
Unknown1
c11_1
Agree1 (17%)
Neither agree nor disagree1 (17%)
Somewhat agree2 (33%)
Strongly disagree2 (33%)
Unknown1
c11_2
Agree2 (33%)
Disagree1 (17%)
Somewhat agree1 (17%)
Somewhat disagree1 (17%)
Strongly disagree1 (17%)
Unknown1
c11_3
Agree2 (33%)
Disagree1 (17%)
Neither agree nor disagree1 (17%)
Somewhat agree1 (17%)
Strongly disagree1 (17%)
Unknown1
c12_1
Agree1 (17%)
Somewhat agree2 (33%)
Somewhat disagree1 (17%)
Strongly disagree2 (33%)
Unknown1
c12_2
Agree2 (33%)
Disagree1 (17%)
Somewhat agree1 (17%)
Strongly disagree2 (33%)
Unknown1
c12_3
Agree2 (33%)
Neither agree nor disagree1 (17%)
Somewhat agree1 (17%)
Strongly disagree2 (33%)
Unknown1
n (%)
#Recoding the values for likert scale questions
OCC_C2_to_C12_recoded <- OCC_C2_to_C12 %>% mutate_at(c("c2_1","c2_2","c2_3","c2_4","c2_5","c3_1","c3_2","c3_3","c4_1","c4_2","c4_3","c5_1","c5_2","c5_3","c6_1","c6_2","c6_3","c6_4","c7_1","c7_2","c7_3","c8_1","c9_1","c9_2","c9_3","c10_1","c10_2","c10_3","c11_1","c11_2","c11_3","c12_1","c12_2","c12_3"), funs(recode(.,"Strongly disagree"=1,"Disagree"=2,"Somewhat disagree"=3,"Neither agree nor disagree"=4,"Somewhat agree"=5,"Agree"=6,"Strongly agree"=7)))


#view(OCC_perceived_usability_1_recoded)         To confirm whether it is recoded


#To analyse vivid_imaginative_experience
tb1_C2_to_C12 <- OCC_C2_to_C12_recoded   %>%
  tbl_summary(
    missing = "always",
      type = list(c(c2_1,c2_2,c2_3,c2_4,c2_5,c3_1,c3_2,c3_3,c4_1,c4_2,c4_3,c5_1,c5_2,c5_3,c6_1,c6_2,c6_3,c6_4,c7_1,c7_2,c7_3,c8_1,c9_1,c9_2,c9_3,c10_1,c10_2,c10_3,c11_1,c11_2,c11_3,c12_1,c12_2,c12_3) ~ "continuous2"),
    statistic = list (all_continuous() ~ "{mean} ({sd})",all_categorical() ~ "{n} ({p}%)")
    )%>%
  

  
  bold_labels %>%
  add_n() %>%
    modify_header (label="**C2 to C12**") %>%
  modify_spanning_header (update = starts_with ("stat_")~"**Frequency**") %>%
  modify_caption("Table 16. C2 to C12_Analysis") %>%
  as_hux_table()

tb1_C2_to_C12
Table 16. C2 to C12_Analysis

Frequency

C2 to C12

N

N = 7

c2_16
Mean (SD)3.83 (1.47)
Unknown1
c2_25
Mean (SD)3.60 (1.52)
Unknown2
c2_35
Mean (SD)3.80 (1.30)
Unknown2
c2_45
Mean (SD)3.40 (1.82)
Unknown2
c2_55
Mean (SD)4.20 (0.84)
Unknown2
c3_16
Mean (SD)3.83 (1.94)
Unknown1
c3_26
Mean (SD)4.17 (2.14)
Unknown1
c3_36
Mean (SD)4.17 (1.83)
Unknown1
c4_16
Mean (SD)2.83 (2.04)
Unknown1
c4_26
Mean (SD)3.33 (2.25)
Unknown1
c4_36
Mean (SD)3.33 (2.07)
Unknown1
c5_16
Mean (SD)3.83 (1.94)
Unknown1
c5_26
Mean (SD)3.33 (2.25)
Unknown1
c5_36
Mean (SD)4.33 (2.34)
Unknown1
c6_16
Mean (SD)3.33 (1.97)
Unknown1
c6_26
Mean (SD)3.17 (2.04)
Unknown1
c6_36
Mean (SD)3.00 (2.19)
Unknown1
c6_46
Mean (SD)2.83 (1.60)
Unknown1
c7_16
Mean (SD)3.50 (2.07)
Unknown1
c7_26
Mean (SD)3.50 (2.07)
Unknown1
c7_36
Mean (SD)3.67 (1.97)
Unknown1
c8_16
Mean (SD)3.17 (2.40)
Unknown1
c9_14
Mean (SD)3.50 (2.38)
Unknown3
c9_24
Mean (SD)3.25 (2.63)
Unknown3
c9_34
Mean (SD)4.25 (2.22)
Unknown3
c10_16
Mean (SD)3.50 (1.97)
Unknown1
c10_26
Mean (SD)3.50 (1.97)
Unknown1
c10_36
Mean (SD)3.67 (2.07)
Unknown1
c11_16
Mean (SD)3.67 (2.16)
Unknown1
c11_26
Mean (SD)3.83 (2.14)
Unknown1
c11_36
Mean (SD)4.00 (2.10)
Unknown1
c12_16
Mean (SD)3.50 (2.17)
Unknown1
c12_26
Mean (SD)3.50 (2.43)
Unknown1
c12_36
Mean (SD)3.83 (2.32)
Unknown1