Load some packages

knitr::opts_chunk$set(
  message = F, 
  warning = F
)

Load the dataset


pacman::p_load(tidyverse, 
               sjPlot)

Explore the dataset

df <- read_csv("https://j.mp/2JJYkeN")

Exploratory data analysis

head(df)

Some thoughts: Year should be integer or factor

Check the amount of NA data

For this I will use the visdat package

glimpse(df)
Rows: 100
Columns: 110
$ RespondentID           <chr> "6151307314", "6150081146", "6144349659", "6139980102", "6131571599", "612…
$ `Power position`       <chr> "Oposition", "Oposition", "Oposition", "Government", "Oposition", "Opositi…
$ Participation          <chr> "yes", "yes", "yes", "Yes", "yes", "yes", "Yes", "Yes", "Yes", "Yes", "Yes…
$ Year                   <dbl> 1956, 1980, 1982, 1949, 1953, 1955, 1951, 1945, 1970, 1956, 1962, 1964, 19…
$ Gender                 <chr> "Man", "Man", "Man", "Man", "Man", "Man", "Man", "Man", "Man", "Man", "Man…
$ Language               <chr> "Russian", "Latvian", "Latvian", "Latvian", "Latvian", "Latvian", "Latvian…
$ Parties                <chr> "Frakcij? \"Saska?a\"", "Pie frakcij?m nepiedero�s deput?ts", "Latvijas Re…
$ YearsMP                <dbl> 18, 25, 7, 6, 1, 25, 2, 25, 25, 6, 6, 15, 6, 6, 2, 3, 1, 4, 17, 4, 4, 5, 7…
$ Chairman               <chr> "No", "No", "No", "Yes", "No", "No", "No", "No", "No", "Yes", "No", "Yes",…
$ Specialisation         <chr> "more than two", "more than two", "more than two", "one or two", "one or t…
$ `8.LETA/BNS`           <chr> "No", "No", "No", "yes", "yes", "No", "No", "No", "No", "No", "No", "No", …
$ Monitoring             <chr> "No", "No", "No", "yes", "yes", "yes", "No", "yes", "No", "No", "yes", "ye…
$ Oft_radio_TV           <chr> "Few times a year", "Once", "Once", "Once", "na", "Less or not at all", "M…
$ Oft_newspaper          <chr> "Few times a year", "twice a week", "twice a month", "twice a month", "na"…
$ Oft_publication        <chr> "Few times a year", "Once", "Once", "Once", "na", "Less or not at all", "t…
$ FB                     <chr> "yes", "twice a week", "twice a month", "twice a week", "yes", "na", "Many…
$ draugiem.lv            <chr> "na", "Many times a week", "Once", "Less or not at all", "na", "na", "yes"…
$ Instagram              <chr> "na", "yes", "twice a month", "yes", "na", "na", "na", "twice a month", "y…
$ vkontakte              <chr> "na", "na", "yes", "na", "na", "na", "na", "na", "na", "na", "na", "yes", …
$ Odnoklassniki          <chr> "na", "yes", "yes", "na", "na", "na", "na", "na", "na", "na", "na", "na", …
$ Twitter                <chr> "na", "na", "yes", "na", "na", "na", "na", "na", "na", "na", "na", "na", "…
$ dont_use               <chr> "na", "na", "na", "na", "na", "yes", "na", "na", "na", "na", "yes", "na", …
$ Soc.media_useful       <chr> "4", "yes", "na", "na", "3", "6", "na", "yes", "na", "na", "na", "na", "ye…
$ Lv_unbiased            <chr> "3", "na", "yes", "na", "4", "3", "2", "na", "na", "na", "4", "na", "na", …
$ LV_truthful            <chr> "4", "5", "na", "4", "4", "3", "4", "na", "3", "6", "4", "na", "3", "na", …
$ LV_complete_pic        <dbl> 4, 2, 5, 4, 3, 3, 4, 1, 3, 3, 4, 4, 3, 5, 3, 4, 3, 3, 2, 5, 3, 2, 3, 3, 4,…
$ LV_know_sub            <dbl> 3, 2, 3, 3, 3, 3, 4, 3, 2, 3, 3, 3, 3, 2, 3, 4, 3, 3, 2, 3, 3, 2, 2, 3, 4,…
$ LV_trustworthy         <dbl> 2, 2, 4, 3, 4, 3, 3, 3, 2, 4, 4, 3, 4, 2, 2, 3, 3, 3, 3, 3, 3, 1, 2, 2, 3,…
$ RU_unbiased            <dbl> 3, 3, 3, 3, 2, 3, 5, 3, 1, 4, 4, 3, 3, 2, 4, 4, 2, 3, 3, 3, 2, 1, 5, 3, 3,…
$ RU_truthful            <dbl> 4, 2, 3, 3, 2, 3, 6, 3, 5, 2, 3, 3, 2, 2, 2, 4, 2, 3, 2, 4, 3, 2, 3, 3, 4,…
$ RU_comp_picture        <dbl> 3, 2, 4, 6, 6, 3, 6, 3, 2, 6, 2, 3, 2, 2, 3, 4, 2, 1, 2, 2, 2, 3, 2, 3, 4,…
$ RU_know_sub            <dbl> 2, 2, 2, 6, 2, 3, 6, 3, 2, 6, 2, 3, 3, 2, 3, 3, 2, 1, 1, 1, 2, 2, 2, 3, 4,…
$ RU_trustworhy          <dbl> 2, 2, 3, 6, 6, 3, 6, 3, 1, 6, 2, 3, 3, 2, 3, 4, 1, 1, 2, 1, 1, 1, 3, 2, 2,…
$ LV_radio_pol           <dbl> 8, 3, 2, 6, 5, 7, 6, 3, 2, 6, 2, 3, 2, 2, 4, 4, 8, 1, 2, 2, 3, 1, 3, 8, 3,…
$ RU_radio_pol           <dbl> 2, 2, 3, 6, 6, 8, 8, 3, 1, 6, 9, 3, 8, 2, 2, 4, 8, 1, 1, 3, 2, 2, 2, 7, 3,…
$ LV_TV_pol              <dbl> 9, 6, 2, 8, 7, 8, 1, 3, 10, 9, 6, 3, 6, 2, 6, 7, 8, 8, 4, 1, 6, 2, 4, 8, 6…
$ RU_TV_pol              <dbl> 1, 4, 5, NA, 7, 8, 7, 5, 7, NA, 10, 8, 9, 8, 6, 8, 8, 2, 5, 8, 5, 5, 6, 6,…
$ LV_newsp_pol           <dbl> 5, 7, 3, 9, 5, 5, 1, 6, 10, 8, 10, 8, 7, 9, 7, 9, 8, 9, 7, 7, 8, 5, 5, 6, …
$ RU_newsp_pol           <dbl> 0, 6, 6, NA, 5, 5, 5, 7, 7, NA, 7, 8, 8, 10, 5, 7, 8, 2, 7, 8, 9, 6, 7, 4,…
$ LV_magaz_pol           <dbl> 6, 7, 3, 6, 4, 4, 1, 6, 4, 9, 9, 8, 7, 10, 3, 6, 8, 6, 3, 7, 4, 6, 6, 3, 6…
$ RU_magaz_pol           <dbl> 0, 5, 2, NA, 3, 4, 5, 6, 6, NA, 8, 8, 8, 10, 3, 4, 8, 2, 4, 6, 5, 4, 7, 2,…
$ LV_newssite_pol        <dbl> 7, 6, 2, 4, 8, 8, 1, 5, 5, NA, 6, 8, 7, 10, 4, 5, 8, 5, 2, 4, 6, 4, 5, 8, …
$ RU_newssite_pol        <dbl> 4, 6, 3, NA, 8, 8, 7, 3, 5, NA, 8, 8, 9, 10, 4, 5, 8, 2, 2, 6, 5, 6, 7, 6,…
$ LV_radio_pub           <dbl> 8, 8, 2, 7, 5, 7, 1, 2, 10, 10, 8, 8, 8, 10, 8, 9, 8, 7, 3, 3, 7, 6, 10, 6…
$ RU_radio_pub           <dbl> 1, 6, 5, NA, 4, 8, 8, 7, 7, NA, 9, 8, 8, 8, 8, 8, 8, 2, 3, 8, 6, 6, 10, 4,…
$ LV_TV_pub              <dbl> 9, 7, 4, 8, 8, 8, 1, 6, 10, 9, 5, 8, 7, 8, 6, 9, 8, 8, 7, 6, 8, 6, 5, 6, 9…
$ RU_TV_pub              <dbl> 1, 6, 7, NA, 8, 8, 7, 6, 9, NA, 10, 8, 9, 10, 6, 9, 8, 5, 7, 9, 6, 8, 6, 4…
$ LV_newsp_pub           <dbl> 6, 8, 6, 9, 3, 5, 1, 6, 10, 8, 9, 8, 8, 10, 7, 8, 8, 9, 8, 8, 9, 8, 5, 5, …
$ RU_newspap_pub         <dbl> 0, 7, 7, NA, 3, 5, 5, 7, 7, NA, 9, 8, 9, 10, 5, 6, 8, 6, 8, 9, 7, 8, 6, 4,…
$ LV_magaz_pub           <dbl> 8, 7, 8, 6, 2, 4, 1, 5, 6, 9, 10, 8, 8, 10, 3, 6, 8, 7, 6, 7, 5, 8, 4, 3, …
$ RU_magaz_pub           <dbl> 3, 7, 4, NA, 2, 4, 5, 7, 8, NA, 8, 8, 9, 10, 3, 6, 8, 6, 6, 8, 6, 8, 6, 2,…
$ LV_newssites_pub       <dbl> 7, 7, 4, 4, 8, 8, 1, 6, 4, NA, 7, 8, 8, 10, 4, 7, 8, 7, 2, 5, 5, 8, 5, 6, …
$ RU_newssites_pub       <dbl> 5, 7, 5, NA, 8, 8, 7, 3, 6, NA, 9, 8, 9, 10, 4, 7, 8, 6, 2, 6, 6, 7, 6, 5,…
$ Much_power             <dbl> 3, 9, 5, 4, 3, 3, 1, 2, 10, 10, 9, 8, 8, 10, 8, 9, 3, 8, 2, 4, 8, 7, 10, 4…
$ Media_owners           <dbl> 4, 7, 7, NA, 4, 3, 3, 8, 7, NA, 2, 8, 4, 10, 8, 9, 3, 7, 2, 9, 7, 6, 10, 4…
$ Motiv_pol_power        <dbl> 3, 5, 7, 4, 2, 3, 6, 7, 4, 4, 3, 8, 3, 10, 3, 2, 3, 1, 4, 7, 3, 6, 3, 3, 4…
$ Journalists_indep      <dbl> 3, 5, 3, 5, 3, 2, 6, 4, 5, 4, 2, 4, 4, 5, 4, 3, 2, 4, 5, 5, 2, 5, 4, 2, 3,…
$ Media_pub_agenda       <dbl> 3, 4, 4, 3, 3, 3, 4, 4, 5, 4, 3, 5, 3, 5, 2, 2, 4, 4, 5, 5, 3, 4, 4, 2, 2,…
$ Politicians_publicity  <dbl> 5, 1, 6, 3, 0, 2, 3, 4, 2, 5, 4, 4, 3, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 4, 3,…
$ Analitic_broadcast     <dbl> 4, 4, 2, 4, 4, 5, 6, 2, 5, 3, 3, 2, 3, 2, 2, 3, 4, 4, 4, 2, 4, 2, 4, 3, 4,…
$ Makes_breakes_politic  <dbl> 5, 5, 4, 4, 3, 4, 3, 4, 4, 3, 3, 4, 4, 5, 3, 4, 4, 4, 4, 4, 3, 3, 4, 4, 5,…
$ Distrust_politicians   <dbl> 4, 5, 4, 4, 5, 4, 6, 5, 4, 4, 4, 3, 4, 4, 2, 4, 4, 4, 3, 4, 4, 4, 3, 4, 5,…
$ More_power_than_MP     <dbl> 5, 5, 4, 5, 2, 3, 1, 3, 3, 4, 3, 4, 4, 5, 3, 3, 4, 4, 3, 5, 4, 4, 3, 4, 5,…
$ More_power_elect       <dbl> 5, 2, 3, 5, 5, 3, 6, 4, 5, 4, 2, 5, 3, 5, 2, 1, 4, 4, 3, 5, 3, 4, 3, 4, 2,…
$ Leak_info              <dbl> 5, 3, 4, 3, 3, 5, 6, 4, 5, 4, 4, 3, 4, 5, 2, 1, 4, 5, 3, 4, 3, 5, 2, 5, 2,…
$ Express_opinion        <dbl> 1, 5, 2, 4, 3, 3, 6, 5, 4, 5, 3, 2, 3, 4, 5, 2, 4, 5, 4, 3, 4, 2, 4, 4, 4,…
$ Agenda_prime           <dbl> 3, 5, 4, 5, 4, 5, 3, 5, 2, 3, 2, 4, 4, 5, 5, 3, 3, 3, 5, 4, 6, 4, 5, 4, 3,…
$ Agenda_ministers       <dbl> 4, 2, 6, 5, 3, 5, 5, 3, 5, 5, 5, 4, 4, 5, 1, 2, 3, 2, 5, 5, 1, 4, 1, 3, 3,…
$ Agenda_MP              <dbl> 3, 4, 3, 4, 3, 4, 4, 5, 5, 4, 4, 5, 4, 4, 5, 4, 3, 5, 4, 5, 4, 5, 4, 3, 5,…
$ Agenda_parties         <dbl> 2, 4, 3, 4, 4, 4, 2, 4, 3, 3, 4, 3, 4, 3, 3, 3, 3, 5, 4, 4, 3, 4, 4, 3, 4,…
$ Agenda_interest_groups <dbl> 4, 4, 3, 3, 3, 4, 2, 4, 3, 3, 4, 3, 3, 3, 2, 4, 3, 3, 3, 4, 2, 4, 3, 3, 3,…
$ Agenda_TV_radio        <dbl> 4, 4, 4, 4, 4, 4, 2, 3, 4, 4, 4, 3, 3, 3, 4, 4, 3, 5, 5, 3, 3, 3, 3, 4, 4,…
$ Agenda_written_press   <dbl> 3, 3, 3, 3, 4, 4, 5, 3, 4, 4, 5, 4, 4, 3, 3, 4, 3, 4, 2, 5, 4, 4, 3, 3, 2,…
$ `10y_parties`          <dbl> 4, 4, 3, 4, 6, 6, 3, 3, 5, 4, 4, 3, 4, 4, 3, 4, 4, 5, 3, 4, 5, 3, 2, 5, 2,…
$ `10y_MP`               <dbl> 3, 2, 3, 3, 5, 5, 6, 4, 3, 4, 7, 2, 4, 2, 2, 3, 4, 5, 2, 4, 2, 3, 2, 4, 2,…
$ `10y_ministers`        <dbl> 6, 7, 2, 6, 5, 6, 4, 4, 7, 5, 6, 2, 5, 2, 7, 6, 4, 5, 7, 3, 6, 3, 5, 5, 6,…
$ `10_years_unions`      <dbl> 2, 7, 5, 5, 3, 3, 6, 6, 5, 4, 6, 6, 5, 6, 6, 5, 4, 5, 6, 6, 6, 7, 5, 4, 5,…
$ `10y_employers`        <dbl> 5, 7, 4, 5, 3, 6, 2, 2, 3, 4, 4, 5, 3, 4, 6, 6, 4, 5, 5, 4, 5, 6, 5, 5, 7,…
$ `10y_municip`          <dbl> 5, 4, 4, 3, 3, 6, 4, 6, 5, 5, 5, 6, 3, 4, 2, 4, 4, 5, 3, 5, 3, 7, 3, 5, 2,…
$ `10y_NGO`              <dbl> 4, 5, 4, 4, NA, 6, 6, 1, 5, 5, 5, 5, 4, 3, 2, 5, 4, 5, 4, 4, 5, 4, 2, 3, 3…
$ `10y_media`            <dbl> 7, 7, 4, 5, 4, 7, 2, 2, 6, 6, 4, 5, 2, 4, 5, 4, 4, 6, 5, 5, 7, 4, 6, 5, 4,…
$ `10y_officials`        <dbl> 7, 5, 3, 4, 2, 6, 6, 4, 6, 6, 5, 5, 5, 4, 2, 5, 4, 5, 4, 6, 3, 5, 1, 6, 3,…
$ `10y_EU`               <dbl> 6, 6, 2, 6, 2, 7, 2, 1, 7, 6, 4, 4, 2, 3, 4, 6, 4, 6, 5, 5, 5, 3, 2, 3, 5,…
$ `10y_OECD`             <dbl> 5, 6, 4, 4, 3, 6, 4, 5, 3, 3, 6, 5, 2, 6, 5, 3, 4, 5, 6, 6, 4, 5, 4, 6, 4,…
$ Inf_Parl_agenda        <chr> "to some extent", "6", "5", "4", "to some extent", "to some extent", "4", …
$ Inf_Govr_agenda        <chr> "quite a little", "5", "4", "3", "quite a little", "to some extent", "na",…
$ Inf_disc_Parliament    <chr> "quite a little", "to some extent", "3", "to some extent", "to some extent…
$ Inf_disc_pub           <chr> "very much", "to some extent", "quite a little", "to some extent", "quite …
$ Inf_MP_success         <chr> "very much", "to some extent", "to some extent", "quite a little", "quite …
$ Inf_deb_Parliament     <chr> "often", "quite a little", "quite a little", "very little or not at all", …
$ Inf_Committees         <chr> "very often", "very much", "quite a little", "very little or not at all", …
$ Inf_party_meeting      <chr> "often", "now and then", "very much", "now and then", "often", "now and th…
$ Inf_question_hour      <chr> "now and then", "often", "often", "often", "now and then", "often", "seldo…
$ Inf_coalition_talks    <chr> "na", "now and then", "now and then", "seldom", "na", "now and then", "na"…
$ Inf_informal_gather    <chr> "very often", "now and then", "very often", "seldom", "na", "now and then"…
$ Act_initiatives        <chr> "Quite small part", "often", "now and then", "often", "Quite small part", …
$ Act_govern             <chr> "Quite large part", "often", "na", "now and then", "None", "Quite large pa…
$ Act_question_govern    <chr> "Quite large part", "Quite large part", "often", "Neither big nor small", …
$ Act_plenar_speach      <chr> "Neither big nor small", "Quite large part", "Quite small part", "Neither …
$ Act_committee_speach   <chr> "Neither big nor small", "Quite large part", "Quite small part", "Neither …
$ Act_oral_hour          <chr> "na", "Very large part", "Quite small part", "Quite small part", "Neither …
$ Info_soc_prob          <chr> "Some", "Quite large part", "Very large part", "Quite small part", "Quite …
$ Info_import_pub        <chr> "Some", "None", "Neither big nor small", "Quite small part", "Some", "Quit…
$ Info_public            <chr> "Quite a lot", "Quite a lot", "Quite large part", "Quite a lot", "Some", "…
$ Inf_polit_weapon       <chr> "Quite little", "Quite a lot", "Some", "Quite a lot", "Quite little", "Qui…
$ Info_other_MP          <chr> "Some", "Often", "Quite little", "Quite a lot", "Some", "Quite a lot", "Ve…
$ Info_imp_parties       <chr> "Often", "Quite a lot", "Often", "Quite little", "Quite a lot", "Quite a l…
$ X108                   <chr> NA, "Quite a lot", "Some", "Some", NA, NA, "Quite a lot", "Very little or …
$ X109                   <chr> NA, "Often", "Some", "Quite a lot", NA, NA, NA, "Some", "Quite a lot", "Of…
$ X110                   <chr> NA, NA, "Quite a lot", NA, NA, NA, NA, "Some", NA, NA, NA, "Quite a lot", …

and plot

pacman::p_load(visdat)

Lot of NAs…

Let’s check some variables

df %>% 
  visdat::vis_dat()

table(df$Gender)

  Man Woman 
   43     9 
table(df$`Power position`)

Government  Oposition 
        61         39 

Seems to me that the data are divided in

demographic data

[1] “RespondentID” “Power position” “Participation” “Year” “Gender”
[6] “Language” “Parties” “YearsMP” “Chairman” “Specialisation”
[11] “8.LETA/BNS”

Some questions about use of social media

“Monitoring” “Oft_radio_TV” “Oft_newspaper” “Oft_publication”
[16] “FB” “draugiem.lv” “Instagram” “vkontakte” “Odnoklassniki”
[21] “Twitter” “dont_use”

some perceptions about their utility

the rest of the columns

We can use an special package to create summary table ready for publication, it’s called gtsummary

table(df$Gender, df$`Power position`)
       
        Government Oposition
  Man           30        13
  Woman          5         4

Learn about the package here: https://github.com/ddsjoberg/gtsummary

For example, a table of the demographic data by power position would be:

pacman::p_load(gtsummary)

As you can see, there is a lot of data to clean here.

I strongly suggest you to learn two of the tidyverse packages:

https://stringr.tidyverse.org/

https://forcats.tidyverse.org/

Questions

What are MPs perception on media power compared to other actors (Columns Agenda_TV_radio and Agenda_written_press compared to Agenda_prime; Agenda_ministers; Agenda_MP; Agenda_parties; Agenda_interest_groups). The survey was in Likert scale 1 - 5);

I don’t have much experience with this, so I google: https://www.google.com/search?q=lickert+data+r&oq=lickert+data+r&aqs=chrome..69i57.7470j0j1&sourceid=chrome&ie=UTF-8

I will subset the dataset, selecting some columns only

df %>% 
  select(`Power position`:Specialisation) %>%  # here I select the desired columns to summarize
  gtsummary::tbl_summary(by = `Power position`)
Characteristic Government, N = 611 Oposition, N = 391
Participation
No 26 (43%) 22 (56%)
yes 0 (0%) 17 (44%)
Yes 35 (57%) 0 (0%)
Year 1,963 (1,954, 1,971) 1,964 (1,956, 1,973)
Unknown 26 22
Gender
Man 30 (86%) 13 (76%)
Woman 5 (14%) 4 (24%)
Unknown 26 22
Language
Latvian 32 (91%) 11 (65%)
Russian 3 (8.6%) 6 (35%)
Unknown 26 22
Parties
Frakcij? "No sirds Latvijai" 0 (0%) 7 (18%)
Frakcij? "Saska?a" 0 (0%) 24 (62%)
Frakcij?��Vienot?ba" 23 (38%) 0 (0%)
Latvijas Re?ionu apvien?bas frakcij? 0 (0%) 7 (18%)
Nacion?l? apvien?bas �Visu Latvijai!�-�T?vzemei un Br?v?bai/LNNK�frakcij? 17 (28%) 0 (0%)
Pie frakcij?m nepiedero�s deput?ts 0 (0%) 1 (2.6%)
Za?o un Zemnieku savien?bas frakcij? 21 (34%) 0 (0%)
YearsMP 6 (4, 6) 7 (3, 18)
Unknown 26 22
Chairman 14 (40%) 3 (18%)
Unknown 26 22
Specialisation
more than two 25 (71%) 11 (65%)
one or two 10 (29%) 6 (35%)
Unknown 26 22

1 Statistics presented: n (%); Median (IQR)

after googling some hours found some packages that can help to analyze Likert data

mydf <- df %>% 
  select(Journalists_indep:Agenda_written_press)

Please, read the documentation and options of the package here: https://cran.r-project.org/web/packages/sjPlot/sjPlot.pdf

Also you can order by some options, see page 25, the option sort.frq = from the plot_likert function

and you can create different plot for different groups, for example for men and women

:)

Learn more

learn about the sjPlot package here:

https://strengejacke.github.io/sjPlot/

Learn even more!

Check the survey package, specially designed to analyze data from surveys

http://r-survey.r-forge.r-project.org/survey/

since is quite an old package, there is a tool that allows you to work with dplyr from tidyverse package:

https://github.com/gergness/srvyr

LS0tCnRpdGxlOiAiTGFzbWEgZGF0YXNldCIKb3V0cHV0OgogIGh0bWxfbm90ZWJvb2s6IGRlZmF1bHQKICBwZGZfZG9jdW1lbnQ6IGRlZmF1bHQKICB3b3JkX2RvY3VtZW50OiBkZWZhdWx0CiAgaHRtbF9kb2N1bWVudDoKICAgIGRmX3ByaW50OiBwYWdlZAplZGl0b3Jfb3B0aW9uczoKICBjaHVua19vdXRwdXRfdHlwZTogaW5saW5lCi0tLQoKYGBge3IsIHNldHVwLCBpbmNsdWRlPUZBTFNFfQprbml0cjo6b3B0c19jaHVuayRzZXQoCiAgbWVzc2FnZSA9IEYsIAogIHdhcm5pbmcgPSBGCikKYGBgCgoKIyBMb2FkIHNvbWUgcGFja2FnZXMKCmBgYHtyfQoK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