Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
42dcfe7
Initial Build
neilhatfield Oct 1, 2024
f5daaec
Update the DESCRIPTION file and survey link
neilhatfield Oct 1, 2024
4e5a93b
Update app.R
Oct 4, 2024
ab04985
Update app.R
Oct 7, 2024
ac804d1
Update app.R
Oct 7, 2024
f7544bf
Update app.R
Oct 7, 2024
68b3f4f
Formatting Changes from Neil
neilhatfield Oct 7, 2024
e1a4fb0
Update app.R
Oct 8, 2024
f41d676
Update app.R
Oct 8, 2024
4aa9b6a
Update app.R
Oct 8, 2024
a6a48b9
Update app.R
Oct 9, 2024
18f4945
Update app.R
Oct 12, 2024
175cb62
Update app.R
Oct 21, 2024
961dddf
Update app.R
Oct 21, 2024
c8241a8
Create workbook.csv
Oct 21, 2024
279ba89
Update app.R
Oct 21, 2024
ec729fd
change name
Oct 28, 2024
5fefd03
quiz
Oct 28, 2024
60cc359
Update app.R
Oct 28, 2024
8e4f672
Create questionbank2.csv
Oct 28, 2024
f40ab79
Update app.R
Oct 28, 2024
3cc0e8d
Update questionbank1.csv
Oct 28, 2024
7fa06b1
Update questionbank1.csv
Oct 28, 2024
a408388
Update app.R
Nov 11, 2024
3a9fc9e
Create data_vote_main.csv
Nov 11, 2024
c7cec75
Update app.R
Nov 11, 2024
3a85ee4
Update app.R
Nov 11, 2024
3c29ae9
Update app.R
Nov 18, 2024
aed629a
Update app.R
Nov 18, 2024
b5a3a67
Update app.R
Nov 18, 2024
5a0ed20
Update app.R
Nov 18, 2024
0890776
Update app.R
Dec 2, 2024
56d3332
questionbank change
Dec 2, 2024
ca8e6e7
Update app.R
Dec 2, 2024
661142c
Update app.R
Dec 2, 2024
3f1dc92
Update app.R
Dec 2, 2024
3366105
Update app.R
Dec 9, 2024
d8a8637
Update app.R
Dec 9, 2024
37b8686
Update app.R
Dec 9, 2024
bdc2091
Update app.R
Dec 9, 2024
d92df5f
Update app.R
Dec 9, 2024
a1862b3
Update app.R
Dec 9, 2024
2ba994b
Update app.R
Dec 9, 2024
b617099
Update app.R
Dec 9, 2024
66c7686
Update app.R
Dec 9, 2024
38acfd8
change
Dec 9, 2024
830cd88
Update app.R
Dec 9, 2024
1ed3727
Update app.R
Dec 9, 2024
1341417
Update app.R
Dec 9, 2024
7c54577
Delete model.jpg
Dec 9, 2024
d0976db
Update app.R
Dec 9, 2024
fe903c9
Update app.R
Dec 9, 2024
951a597
Update app.R
Dec 9, 2024
f4e2208
Update app.R
Dec 9, 2024
f11dea4
Update app.R
Dec 9, 2024
15dc2de
Update app.R
Dec 9, 2024
a0dc34d
Update app.R
Dec 9, 2024
9f6fe21
Update app.R
Dec 9, 2024
441644d
Update DESCRIPTION
Migueldesanta Sep 2, 2025
e479102
Update screenshot.png
Sep 2, 2025
a3780a3
Update README.md
Migueldesanta Sep 2, 2025
0c4da9e
Update README.md
Migueldesanta Sep 2, 2025
ec4d9a8
Update README.md
Migueldesanta Sep 2, 2025
ea2c4f5
Update screenshot.png
Sep 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
Title: Sample App - A Lengthy Title
ShortName: Sample App
Date: 2021-05-13
Title: Two Period Differences-in-Differences Regression
ShortName: Two Period DID
Date: 2024-10-1
Lifecycle: experimental
Authors@R: c(
person(given = "Neil", family = "Hatfield", email = "neil.hatfield@psu.edu", role = c("aut", "cre")),
person(given = "Robert", family = "Carey", email = "rpc5102@psu.edu", role = c("aut"))
person(given = "Xin (Michael)", family = "Yun", email = "yun.xin@outlook.com", role = c("aut", "cre")),
person(given = "Neil", family = "Hatfield", email = "neil.hatfield@psu.edu", role = c("aut")),
person(given = "Dennis", family = "Pearl", email = "dkp13@psu.edu", role = c("aut"))
)
Chapter: Sample Chapter
Description: This app is focused on the common types of xyz.
Chapter: Chapter 14 - Causal Inference
Description: This app is designed to help students explore and understand the core concepts,
assumptions and interpretations of Two-Period Difference-in-Difference (Diff-in-Diff) Regression by experimenting with simulation and real life data.
LearningObjectives: c(
"The student will learn to understand Concept A in way z.",
"The student will learn to understand Concept B as description y."
)
"The student will learn to review prerequisite ideas necessary for understanding Two-Period Diff-in-Diff.",
"The student will learn to identify and evaluate the key assumptions of the Two-Period Diff-in-Diff model.",
"The student will learn to interpret the coefficients and results of a Two-Period Diff-in-Diff regression.",
"The student will practice applying Diff-in-Diff concepts through simulations, real data, and challenge exercises."
)
DisplayMode: Normal
URL: https://psu-eberly.shinyapps.io/Sample_App
BugReports: https://github.com/EducationShinyAppTeam/Sample_App/issues
URL: https://psu-eberly.shinyapps.io/Differences_in_Differences_Regression
BugReports: https://github.com/EducationShinyAppTeam/Differences_in_Differences_Regression/issues
License: CC-BY-NC-SA-4.0
Tags: simulation
Type: Shiny
1,124 changes: 981 additions & 143 deletions app.R

Large diffs are not rendered by default.

21,581 changes: 21,581 additions & 0 deletions cleaned_data.csv

Large diffs are not rendered by default.

21,581 changes: 21,581 additions & 0 deletions data_vote_main.csv

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# App Title
# Two-Period Difference-in-Difference Regression

[![License: CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
![experimental](https://img.shields.io/badge/lifecycle-experimental-orange)
![year](https://img.shields.io/badge/year-2021-lightgrey)
![year](https://img.shields.io/badge/year-2024-lightgrey)
![new](https://img.shields.io/badge/lifecycle-newapp-brightgreen)

![App Screenshot](../docs/screenshot.png)

# App Description
Type the description of your app here
This app is designed to help students explore and understand the core concepts,
assumptions and interpretations of Two-Period Difference-in-Difference (Diff-in-Diff) Regression by experimenting with simulation and real life data.
Binary file modified docs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions questionbank1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
question_id,question_text,choice_1,choice_2,choice_3,correct_answer,correct_feedback,incorrect_feedback
q1,What is the primary purpose of the Parallel Trends Assumption in a Diff-in-Diff model?,To ensure that the treatment group and control group have the same trend before the intervention.,To ensure that the treatment group and control group have the same outcome after the intervention.,To control for confounding variables.,choice_1,Correct! ,Incorrect. What does the Parallel Trends Assumption ensure about the trends in the treatment and control groups before the intervention? How could these trends help isolate the treatment effect?
q2,What does it imply if the treatment group and control group do not have similar trends before the intervention?,The Parallel Trends Assumption is violated.,The intervention has no effect.,The groups are perfectly matched.,choice_1,Correct!,"Incorrect.If the treatment and control groups do not have similar trends before the intervention, what might this indicate about the validity of the Parallel Trends Assumption? Could this affect the causal interpretation of the treatment effect?"
q3,What does the Exchangeability Assumption imply in a Diff-in-Diff model?,There are no systematic differences between the treatment and control groups.,The control group should become the treatment group after the intervention.,The intervention must be randomly assigned.,choice_1,Correct!,"Incorrect.The Exchangeability Assumption implies no systematic differences between groups. How might such differences, if present, lead to bias in estimating the treatment effect?"
q4,What is the expected outcome if the Exchangeability Assumption is violated in a Diff-in-Diff analysis?,The model will be biased due to confounding factors.,The results are unaffected.,The treatment effect will always be overestimated.,choice_1,Correct! ,"Incorrect.If the Exchangeability Assumption is violated, what role do confounding factors play in biasing the treatment effect? How could you address such confounding factors?"
5 changes: 5 additions & 0 deletions questionbank2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
question_id,question_text,choice_1,choice_2,choice_3,correct_answer,correct_feedback,incorrect_feedback
q1,What does the DiD estimator represent in this scenario?,The difference in reading scores between the treatment and control cities in 2023.,The additional change in reading scores in the treatment city after accounting for changes in the control city.,The average difference in reading scores across both cities before 2021.,choice_2,Correct! ,Incorrect. Why is it important to account for changes in the control city when interpreting the treatment effect? What does this adjustment tell us about the additional change in the treatment city?
q2,"If reading scores in the control city also improved, how should this affect the interpretation of the program’s effectiveness?",It could mean that factors other than the reading program contributed to improved scores.,It confirms that the program caused the improvement.,It has no effect on the interpretation.,choice_1,Correct!,"Incorrect.If the control city also experienced an improvement in reading scores, could there be other external factors influencing the results? How would this affect the causal interpretation of the program�s effectiveness?"
q3,Why is the Parallel Trends Assumption important in this scenario?,It ensures that both cities had identical reading scores before 2021.,"It assumes that, without the program, reading score trends would be similar in both cities.",It ensures that only the treatment city had an increase in reading scores.,choice_2,Correct! ,Incorrect.What does the Parallel Trends Assumption imply about the trends in reading scores for both cities before the intervention? How does this assumption support the validity of the Diff-in-Diff analysis?
q4,"If a larger improvement in reading scores is observed in the treatment city after 2021, what might this suggest?",The reading program likely contributed to improved scores in the treatment city.,The control city has lower educational standards.,Random fluctuations likely caused the improvement.,choice_1,Correct!,"Incorrect.If the treatment city shows a larger improvement in reading scores after the program, what could this indicate about the program's impact? Are there alternative explanations that should be considered?"