Introduction

This study examines how inflation(CPI) and corruption affect national happiness. Hamja et al. (2025) found higher inflation lowers happiness, while Ma et al. (2022) showed that corruption reduces life satisfaction.

Literature Review

Article 1 Summary

Hamja et Al. (2025) conductued a study analyzing the impact of economic factors inclusing the Consumer Price Index (CPI), on national happiness during a global pandemic. Using advanced machine learning techniques, they found that higher CPI values, indicating increased inflation and cost of living, were significantly associated with lower happiness scores across countries.

Article 2 Summary

Summarize the empirical article you selected. Discuss the key findings.

Hypothesis

State your directional hypothesis. Specify the expected relationship between your variables. This section should be clear and concise. You need one hypothesis for IV1, one hypothesis for IV2, and one hypothesis for a predicted interaction. If you are running a logistic regression, you do not need a hypothesis for an interaction.

Method

Sample

Describe the sample used in your study. Include details about the population, sample size, and any relevant demographic information.

Variables and Operationalization

List your independent and dependent variables. Explain how each variable was operationalized, including the range for continuous variables and levels for categorical variables.

Loading Required Libraries

# Load necessary libraries
library(ggplot2)
library(dplyr)
library(psych)
library(knitr)
library(readxl)
# Load your dataset in this chunk
library(readxl)
world_happiness_2 <- read_excel("Downloads/world happiness 2.xlsx")
## Error: `path` does not exist: 'Downloads/world happiness 2.xlsx'
View(world_happiness_2)
## Error: object 'world_happiness_2' not found

Descriptive Statistics

Present the descriptive statistics for your variables. Include appropriate measures of central tendency (mean, median), variability (standard deviation, range), and frequency distributions where applicable. Use R code chunks to generate and display your results.

# Example R code for descriptive statistics
psych::describe(iris)
##              vars   n mean   sd median trimmed  mad min max range  skew
## Sepal.Length    1 150 5.84 0.83   5.80    5.81 1.04 4.3 7.9   3.6  0.31
## Sepal.Width     2 150 3.06 0.44   3.00    3.04 0.44 2.0 4.4   2.4  0.31
## Petal.Length    3 150 3.76 1.77   4.35    3.76 1.85 1.0 6.9   5.9 -0.27
## Petal.Width     4 150 1.20 0.76   1.30    1.18 1.04 0.1 2.5   2.4 -0.10
## Species*        5 150 2.00 0.82   2.00    2.00 1.48 1.0 3.0   2.0  0.00
##              kurtosis   se
## Sepal.Length    -0.61 0.07
## Sepal.Width      0.14 0.04
## Petal.Length    -1.42 0.14
## Petal.Width     -1.36 0.06
## Species*        -1.52 0.07

Statistical Analysis

Analysis

Perform your chosen analysis. Make sure your output shows.

# Linear regression: Predict Petal Length using Sepal Width and Sepal Length
model <- lm(Petal.Length ~ Sepal.Width + Sepal.Length, data = iris)
summary(model)
## 
## Call:
## lm(formula = Petal.Length ~ Sepal.Width + Sepal.Length, data = iris)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.25582 -0.46922 -0.05741  0.45530  1.75599 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -2.52476    0.56344  -4.481 1.48e-05 ***
## Sepal.Width  -1.33862    0.12236 -10.940  < 2e-16 ***
## Sepal.Length  1.77559    0.06441  27.569  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.6465 on 147 degrees of freedom
## Multiple R-squared:  0.8677, Adjusted R-squared:  0.8659 
## F-statistic:   482 on 2 and 147 DF,  p-value: < 2.2e-16

Post-hoc Power Analysis

Run a post-hoc power analysis with the pwr package. Use the pwr.f2.test function for multiple regression power analysis.

library(pwr)

Results Interpretation

Results are interpreted clearly using APA style; connection to hypothesis is made; statistical significance and practical implications are addressed; power level is addressed.

Graph and Table

Include at least one table and one graph that effectively summarize your analysis and findings. Use R code chunks to generate these visualizations.

#Example R code for creating a graph
# You will be performing a median split
# Median split for Experience to visualize the linear x linear interaction
iris <- iris %>%
  mutate(Sepal_Length_Split = ifelse(Sepal.Length > median(Sepal.Length), "Long Sepals", "Short Sepals"))

# Plot the interaction using the median split
ggplot(iris, aes(x = Sepal.Width, y = Petal.Length, color = Sepal_Length_Split)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE) +
  labs(title = "Effect of Sepal Width on Petal Length by Sepal Length (Median Split)",
       x = "Sepal Width", y = "Petal Length") +
  scale_color_manual(values = c("Long Sepals" = "green", "Short Sepals" = "orange")) +
  theme_apa()

# Example R code for creating a table
# Create a summary table by Species

summary_table <- iris %>%
  group_by(Sepal_Length_Split) %>%
  dplyr::summarise(
    Petal.Length.Mean = mean(Petal.Length),
    Petal.Length.SD = sd(Petal.Length),
    Petal.Length.Min = min(Petal.Length),
    Petal.Length.Max = max(Petal.Length)
  )
# Display the table using knitr::kable()
kable(summary_table, caption = "Descriptive Statistics for Iris Sepal Length")
Descriptive Statistics for Iris Sepal Length
Sepal_Length_Split Petal.Length.Mean Petal.Length.SD Petal.Length.Min Petal.Length.Max
Long Sepals 5.238571 0.6876325 4 6.9
Short Sepals 2.462500 1.3500469 1 5.1

Discussion

Discuss the implications of your results for psychological theory or practice. Address the following points:

  • Implications: What do your findings mean in the context of existing research? The analysis shows how multiple variables togther can predict an outcome, similar to how psychologists stidy factors like stress and support to understand mental health.
  • Limitations: Identify any limitations of your study. How might these limitations have affected your results? The dataset used is botanical, not psychological, and using a median split reduces are corretional not casual.
  • Future Directions: Suggest potential future research directions based on your findings. Apply these methods to real psychologica data, avoid splitting continous varibales, and consider using more advanced research. # References Fisher, R. A. (1936). The use of multiple measurements in taxonomic problems. Annals of Eugenics, 7(2), 179–188.

Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum.

List the articles you reviewed in APA format. Do not worry about the indentations.