research0812

library(readxl)
data <- read_excel("~/Desktop/data/research0812.xlsx")
data[data == "NA"] <- NA
data[data == ""] <- NA
names(data) <- trimws(names(data))
data$Year <- as.numeric(data$Year)

data$`Political stability` <- as.numeric(data$`Political stability`)
data$`FSI(100-FSI)` <- as.numeric(data$`FSI(100-FSI)`)
data$Democracy <- as.numeric(data$Democracy)

data$Post2022 <- as.numeric(data$Post2022)
data$SCS <- as.numeric(data$SCS)

data$`Trade China` <- as.numeric(data$`Trade China`)
data$`Sec US` <- as.numeric(data$`Sec US`)

data$`Dis Elite Preference` <- as.numeric(data$`Dis Elite Preference`)
data$`Dis Unga Alignment` <- as.numeric(data$`Dis Unga Alignment`)
model_elite <- lm(

`Dis Elite Preference` ~

Democracy +
Post2022 +
SCS +

`Political stability` +
`FSI(100-FSI)` +
`Trade China` +
`Sec US`,

data = data

)

summary(model_elite)

Call:
lm(formula = `Dis Elite Preference` ~ Democracy + Post2022 + 
    SCS + `Political stability` + `FSI(100-FSI)` + `Trade China` + 
    `Sec US`, data = data)

Residuals:
   Min     1Q Median     3Q    Max 
-34.85 -10.16  -3.21  11.65  43.05 

Coefficients:
                       Estimate Std. Error t value Pr(>|t|)  
(Intercept)            90.44805   48.92342   1.849   0.0737 .
Democracy              -7.26603    3.47952  -2.088   0.0448 *
Post2022               -9.19763    6.83639  -1.345   0.1880  
SCS                    17.79026    8.65478   2.056   0.0481 *
`Political stability`  -0.11770    0.74422  -0.158   0.8753  
`FSI(100-FSI)`        0.02064    0.53026   0.039   0.9692  
`Trade China`         -17.09603   36.37006  -0.470   0.6415  
`Sec US`              -24.36829   27.06405  -0.900   0.3746  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 20.67 on 32 degrees of freedom
  (40 observations deleted due to missingness)
Multiple R-squared:  0.3808,    Adjusted R-squared:  0.2454 
F-statistic: 2.811 on 7 and 32 DF,  p-value: 0.02121
model_unga <- lm(

`Dis Unga Alignment` ~

Democracy +
Post2022 +
SCS +

`Political stability` +
`FSI(100-FSI)` +
`Trade China` +
`Sec US`,

data = data

)

summary(model_unga)

Call:
lm(formula = `Dis Unga Alignment` ~ Democracy + Post2022 + SCS + 
    `Political stability` + `FSI(100-FSI)` + `Trade China` + 
    `Sec US`, data = data)

Residuals:
     Min       1Q   Median       3Q      Max 
-1.07942 -0.25982  0.02215  0.21699  0.71498 

Coefficients:
                       Estimate Std. Error t value Pr(>|t|)    
(Intercept)            2.828934   0.479241   5.903 1.08e-07 ***
Democracy             -0.084478   0.032768  -2.578   0.0120 *  
Post2022              -1.165356   0.095427 -12.212  < 2e-16 ***
SCS                    0.205679   0.086026   2.391   0.0194 *  
`Political stability`  0.007634   0.006340   1.204   0.2324    
`FSI(100-FSI)`      -0.006109   0.004570  -1.337   0.1855    
`Trade China`         -0.001305   0.412716  -0.003   0.9975    
`Sec US`               0.181308   0.296237   0.612   0.5424    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.3286 on 72 degrees of freedom
Multiple R-squared:  0.7275,    Adjusted R-squared:  0.701 
F-statistic: 27.46 on 7 and 72 DF,  p-value: < 2.2e-16
####################################################
## Packages
####################################################

library(readxl)
library(ggplot2)
Warning: package 'ggplot2' was built under R version 4.5.2
library(broom)
library(fixest)
Warning: package 'fixest' was built under R version 4.5.2
model_elite_fe <- feols(

`Dis Elite Preference` ~

Democracy +
Post2022 +
SCS +

`Political stability` +
`FSI(100-FSI)` +
`Trade China` +
`Sec US`

|

Country,

data=data

)
NOTE: 40 observations removed because of NA values (LHS: 40).
The variable 'SCS' has been removed because of collinearity (see $collin.var).
summary(model_elite_fe)
OLS estimation, Dep. Var.: `Dis Elite Preference`
Observations: 40
Fixed-effects: Country: 8
Standard-errors: IID 
                        Estimate Std. Error   t value Pr(>|t|) 
Democracy               0.272489   14.50574  0.018785  0.98516 
Post2022               -8.025541    7.97910 -1.005821  0.32377 
`Political stability`   0.100143    1.88754  0.053055  0.95809 
`FSI(100-FSI)`       -0.694496    2.04657 -0.339346  0.73708 
`Trade China`         -11.743266  108.37094 -0.108362  0.91454 
`Sec US`              -10.185578   25.81177 -0.394610  0.69635 
... 1 variable was removed because of collinearity (SCS)
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
RMSE: 13.1     Adj. R2: 0.533708
             Within R2: 0.13795 
model_unga_fe <- feols(

`Dis Unga Alignment` ~

Democracy +
Post2022 +
SCS +

`Political stability` +
`FSI(100-FSI)` +
`Trade China` +
`Sec US`

|

Country,

data=data

)
The variable 'SCS' has been removed because of collinearity (see $collin.var).
summary(model_unga_fe)
OLS estimation, Dep. Var.: `Dis Unga Alignment`
Observations: 80
Fixed-effects: Country: 8
Standard-errors: IID 
                       Estimate Std. Error    t value  Pr(>|t|)    
Democracy              0.002838   0.090813   0.031249   0.97517    
Post2022              -1.222573   0.102816 -11.890880 < 2.2e-16 ***
`Political stability` -0.009651   0.015518  -0.621949   0.53612    
`FSI(100-FSI)`       0.001467   0.006891   0.212934   0.83203    
`Trade China`          1.417899   1.097875   1.291495   0.20104    
`Sec US`               0.066962   0.283074   0.236552   0.81374    
... 1 variable was removed because of collinearity (SCS)
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
RMSE: 0.270795     Adj. R2: 0.753905
                 Within R2: 0.752271
library(fixest)

model <- feols(

`Dis Unga Alignment`

~

Democracy
+
Post2022
+
SCS

+
`Political stability`
+
`FSI(100-FSI)`
+
`Trade China`
+
`Sec US`,

cluster = ~Country,

data=data

)

summary(model)
OLS estimation, Dep. Var.: `Dis Unga Alignment`
Observations: 80
Standard-errors: Clustered (Country) 
                       Estimate Std. Error    t value   Pr(>|t|)    
(Intercept)            2.828934   0.475447   5.950055 5.7003e-04 ***
Democracy             -0.084478   0.029329  -2.880375 2.3639e-02 *  
Post2022              -1.165356   0.115638 -10.077603 2.0331e-05 ***
SCS                    0.205679   0.085352   2.409784 4.6789e-02 *  
`Political stability`  0.007634   0.006533   1.168676 2.8079e-01    
`FSI(100-FSI)`      -0.006109   0.005089  -1.200306 2.6906e-01    
`Trade China`         -0.001305   0.528418  -0.002469 9.9810e-01    
`Sec US`               0.181308   0.159126   1.139400 2.9202e-01    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
RMSE: 0.311764   Adj. R2: 0.70099
library(fixest)

model <- feols(

`Dis Elite Preference`

~

Democracy
+
Post2022
+
SCS

+
`Political stability`
+
`FSI(100-FSI)`
+
`Trade China`
+
`Sec US`,

cluster = ~Country,

data=data

)
NOTE: 40 observations removed because of NA values (LHS: 40).
summary(model)
OLS estimation, Dep. Var.: `Dis Elite Preference`
Observations: 40
Standard-errors: Clustered (Country) 
                        Estimate Std. Error   t value Pr(>|t|)    
(Intercept)            90.448053  61.744159  1.464884 0.186370    
Democracy              -7.266026   2.874404 -2.527838 0.039357 *  
Post2022               -9.197635   5.980917 -1.537830 0.167977    
SCS                    17.790264   8.950939  1.987531 0.087208 .  
`Political stability`  -0.117698   0.687905 -0.171096 0.868989    
`FSI(100-FSI)`        0.020637   0.516190  0.039980 0.969226    
`Trade China`         -17.096027  41.901784 -0.408002 0.695463    
`Sec US`              -24.368290  17.577559 -1.386330 0.208196    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
RMSE: 18.5   Adj. R2: 0.245355
library(ggplot2)
library(dplyr)
Warning: package 'dplyr' was built under R version 4.5.2

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
elite_trend <- data %>%
  filter(!is.na(`Dis Elite Preference`)) %>%
  group_by(Year) %>%
  summarise(
    Mean = mean(`Dis Elite Preference`, na.rm = TRUE),
    SD = sd(`Dis Elite Preference`, na.rm = TRUE),
    N = n(),
    SE = SD/sqrt(N)
  )

ggplot(elite_trend,
       aes(x = Year,
           y = Mean)) +
  geom_line(linewidth = 1.2,
            color = "#2C7FB8") +
  geom_point(size = 3,
             color = "#2C7FB8") +
  geom_errorbar(aes(ymin = Mean-SE,
                    ymax = Mean+SE),
                width = .15) +
  geom_vline(xintercept = 2022,
             linetype = "dashed") +
  scale_x_continuous(
    breaks = 2019:2023
  ) +
  labs(
    title = "Elite Preference Distance",
    x = "Year",
    y = "Average Elite Preference Distance"
  ) +
  theme_classic(base_size = 14)

unga_trend <- data %>%
  group_by(Year) %>%
  summarise(
    Mean = mean(`Dis Unga Alignment`, na.rm = TRUE),
    SD = sd(`Dis Unga Alignment`, na.rm = TRUE),
    N = n(),
    SE = SD/sqrt(N)
  )

ggplot(unga_trend,
       aes(x = Year,
           y = Mean)) +
  geom_line(linewidth = 1.2,
            color = "#D95F02") +
  geom_point(size = 3,
             color = "#D95F02") +
  geom_errorbar(aes(ymin = Mean-SE,
                    ymax = Mean+SE),
                width = .15) +
  geom_vline(xintercept = 2022,
             linetype = "dashed") +
  scale_x_continuous(
    breaks = 2014:2023
  ) +
  labs(
    title = "UNGA Alignment",
    x = "Year",
    y = "Average UNGA Alignment"
  ) +
  theme_classic(base_size = 14)

ggplot(
  data %>% filter(!is.na(`Dis Elite Preference`)),
  aes(
    Year,
    `Dis Elite Preference`,
    color = Country,
    group = Country
  )
) +
  geom_line(linewidth = 1) +
  geom_point(size = 2) +
  geom_vline(xintercept = 2022,
             linetype = "dashed") +
  scale_x_continuous(breaks = 2019:2023) +
  labs(
    title = "Elite Preference Distance",
    x = "Year",
    y = "Elite Preference Distance"
  ) +
  theme_classic(base_size = 14)

ggplot(
  data,
  aes(
    Year,
    `Dis Unga Alignment`,
    color = Country,
    group = Country
  )
) +
  geom_line(linewidth = 1) +
  geom_point(size = 2) +
  geom_vline(xintercept = 2022,
             linetype = "dashed") +
  scale_x_continuous(breaks = 2014:2023) +
  labs(
    title = "UNGA Alignment",
    x = "Year",
    y = "UNGA Alignment"
  ) +
  theme_classic(base_size = 14)

library(ggplot2)
library(dplyr)

ggplot(
  data %>%
    filter(
      Country %in% c("Vietnam", "Malaysia"),
      !is.na(`Dis Elite Preference`)
    ),
  aes(
    x = Year,
    y = `Dis Elite Preference`,
    color = Country,
    group = Country
  )
) +
  geom_line(linewidth = 1.2) +
  geom_point(size = 3) +
  geom_vline(xintercept = 2022, linetype = "dashed") +
  scale_x_continuous(breaks = 2019:2023) +
  labs(
    title = "Elite Preference Distance",
    subtitle = "Vietnam vs. Malaysia",
    x = "Year",
    y = "Elite Preference Distance"
  ) +
  theme_classic(base_size = 14)

ggplot(
  data %>%
    filter(Country %in% c("Vietnam", "Malaysia")),
  aes(
    x = Year,
    y = `Dis Unga Alignment`,
    color = Country,
    group = Country
  )
) +
  geom_line(linewidth = 1.2) +
  geom_point(size = 3) +
  geom_vline(xintercept = 2022, linetype = "dashed") +
  scale_x_continuous(breaks = 2014:2023) +
  labs(
    title = "UNGA Alignment",
    subtitle = "Vietnam vs. Malaysia",
    x = "Year",
    y = "UNGA Alignment"
  ) +
  theme_classic(base_size = 14)

data$Period <- ifelse(data$Year < 2022,
                      "Pre-2022",
                      "Post-2022")
ggplot(
  subset(data, !is.na(`Dis Elite Preference`)),
  aes(x = Period,
      y = `Dis Elite Preference`,
      fill = Period)
) +
  geom_boxplot(alpha = .7) +
  geom_jitter(aes(color = Country),
              width = .12,
              size = 2,
              alpha = .7) +
  theme_classic(base_size = 14)

library(ggplot2)

data$Period <- ifelse(data$Year < 2022,
                      "Pre-2022",
                      "Post-2022")

ggplot(
  subset(data, !is.na(`Dis Elite Preference`)),
  aes(x = Period,
      y = `Dis Elite Preference`,
      fill = Period)
) +
  geom_boxplot(width = 0.6,
               alpha = 0.7,
               outlier.size = 2) +
  geom_jitter(width = 0.12,
              alpha = 0.6,
              size = 2) +
  labs(
    title = "Elite Preference Distance Before and After 2022",
    x = "",
    y = "Elite Preference Distance"
  ) +
  theme_classic(base_size = 14) +
  theme(legend.position = "none")

library(ggplot2)

data$Period <- ifelse(data$Year < 2022,
                      "Pre-2022",
                      "Post-2022")

ggplot(
  subset(data, !is.na(`Dis Elite Preference`)),
  aes(x = Period,
      y = `Dis Elite Preference`)
) +
  geom_boxplot(
    fill = "white",
    colour = "black",
    width = 0.55,
    outlier.shape = NA
  ) +
  geom_jitter(
    colour = "grey40",
    width = 0.10,
    size = 2,
    alpha = 0.7
  ) +
  labs(
    x = "",
    y = "Elite Preference Distance"
  ) +
  theme_classic(base_size = 14)

data$Period <- ifelse(data$Year < 2022,
                      "Pre-2022",
                      "Post-2022")

data$Period <- factor(
  data$Period,
  levels = c("Pre-2022", "Post-2022")
)
ggplot(
  data,
  aes(x = Period,
      y = `Dis Unga Alignment`)
) +
  geom_boxplot(
    fill = "white",
    colour = "black",
    width = 0.55,
    outlier.shape = NA
  ) +
  geom_jitter(
    colour = "grey40",
    width = 0.10,
    size = 2,
    alpha = 0.7
  ) +
  labs(
    x = "",
    y = "UNGA Alignment"
  ) +
  theme_classic(base_size = 14)

data$Period <- ifelse(data$Year < 2022,
                      "Pre-2022",
                      "Post-2022")

data$Period <- factor(
  data$Period,
  levels = c("Pre-2022", "Post-2022")
)
library(ggplot2)
library(broom)

coef <- tidy(model_unga,
             conf.int = TRUE)

coef <- subset(coef,
               term != "(Intercept)")
coef$term <- factor(
  coef$term,
  levels = rev(c(
    "Democracy",
    "Post2022",
    "SCS",
    "Political stability",
    "FSI(100-FSI)",
    "Trade China",
    "Sec US"
  )),
  labels = rev(c(
    "Democracy",
    "Post-2022",
    "South China Sea Claimant",
    "Political Stability",
    "Government Legitimacy",
    "Trade Dependence on China",
    "Security Ties with the U.S."
  ))
)
ggplot(coef,
       aes(x = estimate,
           y = term)) +

  geom_vline(xintercept = 0,
             linetype = "dashed",
             colour = "grey50") +

  geom_errorbarh(
      aes(xmin = conf.low,
          xmax = conf.high),
      height = .18,
      linewidth = .7
  ) +

  geom_point(size = 2.8) +

  labs(
      title = "Coefficient Plot",
      subtitle = "Dependent Variable: UNGA Alignment",
      x = "Coefficient Estimate (95% CI)",
      y = NULL
  ) +

  theme_classic(base_size = 14) +

  theme(
      plot.title = element_text(
          face = "bold",
          hjust = 0.5
      ),
      plot.subtitle = element_text(
          hjust = 0.5
      )
  )
Warning: `geom_errorbarh()` was deprecated in ggplot2 4.0.0.
ℹ Please use the `orientation` argument of `geom_errorbar()` instead.
`height` was translated to `width`.

labs(
    title = "(A) Coefficient Plot for UNGA Alignment",
    x = "Coefficient Estimate (95% CI)",
    y = NULL
)
<ggplot2::labels> List of 3
 $ x    : chr "Coefficient Estimate (95% CI)"
 $ y    : NULL
 $ title: chr "(A) Coefficient Plot for UNGA Alignment"
library(broom)
library(ggplot2)

# 擷取 Elite Preference Distance 模型結果
coef_elite <- tidy(
  model_elite,
  conf.int = TRUE
)

# 移除截距
coef_elite <- subset(
  coef_elite,
  term != "(Intercept)"
)

# 美化變數名稱
coef_elite$term <- factor(
  coef_elite$term,
  levels = rev(c(
    "Democracy",
    "Post2022",
    "SCS",
    "Political stability",
    "FSI(100-FSI)",
    "Trade China",
    "Sec US"
  )),
  labels = rev(c(
    "Democracy",
    "Post-2022",
    "South China Sea Claimant",
    "Political Stability",
    "Government Legitimacy",
    "Trade Dependence on China",
    "Security Ties with the U.S."
  ))
)

# 畫森林圖
ggplot(
  coef_elite,
  aes(
    x = estimate,
    y = term
  )
) +
  geom_vline(
    xintercept = 0,
    linetype = "dashed",
    colour = "grey50"
  ) +
  geom_errorbarh(
    aes(
      xmin = conf.low,
      xmax = conf.high
    ),
    height = 0.18,
    linewidth = 0.7
  ) +
  geom_point(size = 3) +
  labs(
    title = "OLS Estimates for Elite Preference Distance",
    x = "Coefficient Estimate (95% Confidence Interval)",
    y = NULL
  ) +
  theme_classic(base_size = 14) +
  theme(
    plot.title = element_text(face = "bold", hjust = 0.5)
  )
`height` was translated to `width`.

library(broom)
library(ggplot2)

# 擷取 UNGA Alignment 模型結果
coef_unga <- tidy(
  model_unga,
  conf.int = TRUE
)

# 移除截距
coef_unga <- subset(
  coef_unga,
  term != "(Intercept)"
)

# 美化變數名稱
coef_unga$term <- factor(
  coef_unga$term,
  levels = rev(c(
    "Democracy",
    "Post2022",
    "SCS",
    "Political stability",
    "FSI(100-FSI)",
    "Trade China",
    "Sec US"
  )),
  labels = rev(c(
    "Democracy",
    "Post-2022",
    "South China Sea Claimant",
    "Political Stability",
    "Government Legitimacy",
    "Trade Dependence on China",
    "Security Ties with the U.S."
  ))
)

# 畫森林圖
ggplot(
  coef_unga,
  aes(
    x = estimate,
    y = term
  )
) +
  geom_vline(
    xintercept = 0,
    linetype = "dashed",
    colour = "grey50"
  ) +
  geom_errorbarh(
    aes(
      xmin = conf.low,
      xmax = conf.high
    ),
    height = 0.18,
    linewidth = 0.7
  ) +
  geom_point(size = 3) +
  labs(
    title = "OLS Estimates for UNGA Alignment",
    x = "Coefficient Estimate (95% Confidence Interval)",
    y = NULL
  ) +
  theme_classic(base_size = 14) +
  theme(
    plot.title = element_text(
      face = "bold",
      hjust = 0.5
    )
  )
`height` was translated to `width`.

library(ggplot2)
library(broom)

coef_unga <- tidy(
  model_unga,
  conf.int = TRUE
)

# 移除截距
coef_unga <- subset(
  coef_unga,
  term != "(Intercept)"
)

# 重新命名所有變數
name_map <- c(
  "Democracy" = "Democracy",
  "Post2022" = "Post-2022",
  "SCS" = "South China Sea Claimant",
  "Political stability" = "Political Stability",
  "FSI(100-FSI)" = "Government Legitimacy",
  "Trade China" = "Trade Dependence on China",
  "Sec US" = "Security Ties with the U.S."
)

coef_unga$variable <- name_map[coef_unga$term]

# 指定圖上順序
coef_unga$variable <- factor(
  coef_unga$variable,
  levels = rev(c(
    "Democracy",
    "Post-2022",
    "South China Sea Claimant",
    "Political Stability",
    "Government Legitimacy",
    "Trade Dependence on China",
    "Security Ties with the U.S."
  ))
)

# 森林圖
ggplot(
  coef_unga,
  aes(
    x = estimate,
    y = variable
  )
) +
  geom_vline(
    xintercept = 0,
    linetype = "dashed",
    colour = "grey50"
  ) +
  geom_errorbarh(
    aes(
      xmin = conf.low,
      xmax = conf.high
    ),
    height = 0.18,
    linewidth = 0.7
  ) +
  geom_point(size = 3) +
  labs(
    title = "OLS Estimates for UNGA Alignment",
    x = "Coefficient Estimate (95% Confidence Interval)",
    y = NULL
  ) +
  theme_classic(base_size = 14) +
  theme(
    plot.title = element_text(
      face = "bold",
      hjust = 0.5
    )
  )
`height` was translated to `width`.

names(data) <- trimws(names(data))
library(fixest)

model_elite <- feols(
  `Dis Elite Preference` ~
    Democracy +
    Post2022 +
    SCS +
    `Political stability` +
    `FSI(100-FSI)` +
    `Trade China` +
    `Sec US`,
  cluster = ~Country,
  data = data
)
NOTE: 40 observations removed because of NA values (LHS: 40).
model_unga <- feols(
  `Dis Unga Alignment` ~
    Democracy +
    Post2022 +
    SCS +
    `Political stability` +
    `FSI(100-FSI)` +
    `Trade China` +
    `Sec US`,
  cluster = ~Country,
  data = data
)
coef_unga <- tidy(
  model_unga,
  conf.int = TRUE
) %>%
  filter(term != "(Intercept)") %>%
  mutate(
    variable = recode(
      term,
      "Democracy" = "Democracy",
      "Post2022" = "Post-2022",
      "SCS" = "South China Sea Claimant",
      "`Political stability`" = "Political Stability",
      "`FSI(100-FSI)`" = "Government Legitimacy",
      "`Trade China`" = "Trade Dependence on China",
      "`Sec US`" = "Security Ties with the U.S."
    )
  )

coef_unga$variable <- factor(
  coef_unga$variable,
  levels = rev(c(
    "Democracy",
    "Post-2022",
    "South China Sea Claimant",
    "Political Stability",
    "Government Legitimacy",
    "Trade Dependence on China",
    "Security Ties with the U.S."
  ))
)

ggplot(
  coef_unga,
  aes(
    x = estimate,
    y = variable
  )
) +
  geom_vline(
    xintercept = 0,
    linetype = "dashed",
    colour = "grey50"
  ) +
  geom_errorbarh(
    aes(
      xmin = conf.low,
      xmax = conf.high
    ),
    height = 0.18,
    linewidth = 0.7
  ) +
  geom_point(size = 3) +
  labs(
    title = "OLS Estimates for UNGA Alignment",
    x = "Coefficient Estimate (95% Confidence Interval)",
    y = NULL
  ) +
  theme_classic(base_size = 14) +
  theme(
    plot.title = element_text(
      face = "bold",
      hjust = 0.5
    )
  )
`height` was translated to `width`.

summary(model_elite)
OLS estimation, Dep. Var.: `Dis Elite Preference`
Observations: 40
Standard-errors: Clustered (Country) 
                        Estimate Std. Error   t value Pr(>|t|)    
(Intercept)            90.448053  61.744159  1.464884 0.186370    
Democracy              -7.266026   2.874404 -2.527838 0.039357 *  
Post2022               -9.197635   5.980917 -1.537830 0.167977    
SCS                    17.790264   8.950939  1.987531 0.087208 .  
`Political stability`  -0.117698   0.687905 -0.171096 0.868989    
`FSI(100-FSI)`        0.020637   0.516190  0.039980 0.969226    
`Trade China`         -17.096027  41.901784 -0.408002 0.695463    
`Sec US`              -24.368290  17.577559 -1.386330 0.208196    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
RMSE: 18.5   Adj. R2: 0.245355
coef(model_elite)
          (Intercept)             Democracy              Post2022 
          90.44805314           -7.26602621           -9.19763463 
                  SCS `Political stability`      `FSI(100-FSI)` 
          17.79026415           -0.11769774            0.02063707 
        `Trade China`              `Sec US` 
         -17.09602686          -24.36829028 
library(broom)

coef_elite <- tidy(model_elite, conf.int = TRUE)

coef_elite
# A tibble: 8 × 7
  term                  estimate std.error statistic p.value conf.low conf.high
  <chr>                    <dbl>     <dbl>     <dbl>   <dbl>    <dbl>     <dbl>
1 (Intercept)            90.4       61.7      1.46    0.186    -55.6    236.   
2 Democracy              -7.27       2.87    -2.53    0.0394   -14.1     -0.469
3 Post2022               -9.20       5.98    -1.54    0.168    -23.3      4.94 
4 SCS                    17.8        8.95     1.99    0.0872    -3.38    39.0  
5 `Political stability`  -0.118      0.688   -0.171   0.869     -1.74     1.51 
6 `FSI(100-FSI)`        0.0206     0.516    0.0400  0.969     -1.20     1.24 
7 `Trade China`         -17.1       41.9     -0.408   0.695   -116.      82.0  
8 `Sec US`              -24.4       17.6     -1.39    0.208    -65.9     17.2