Skip to main content

Questions tagged [r]

The application of the statistical programming language "r" to economic problems.

Filter by
Sorted by
Tagged with
0 votes
0 answers
33 views

What are the true normalized cointegration vectors in R (ca.jo, cajorls and VECM functions) and how to interpret them?

I'm struggling with understand the difference between (and why there is this difference) the normalized cointegration vectors provided by the ca.jo function and the ...
Daniel Xavier's user avatar
1 vote
1 answer
93 views

Can global real GDP be calculated using nominal GDP and inflation rate? If so what is the error?

I am attempting to calculate (in R) the global real GDP using what I assume is the nominal GDP from the World Bank and what I can only identify as the inflation rate, also from the World bank. ...
At_my_wits_end_99's user avatar
3 votes
1 answer
82 views

Variable dropped for collinearity in feols package in R (TWFE)

sorry if this is a basic question (I'm new to econometrics). I have the following regression model: $Y_{i,t} = \alpha_i + \gamma_t + \beta_1\cdot X_{1,i,t} + \beta_2 \cdot X_{2,i} + \beta_3 \cdot X_{3,...
user308036's user avatar
1 vote
2 answers
51 views

How to present a Difference-in-Difference regression output using Rstudio?

How do I present a difference-in-differences regression output like the following in R?
asdf's user avatar
  • 23
1 vote
0 answers
14 views

GMM panel data in R pdynmc. What's the correct format of missing values?

I have an unbalanced panel with firm level data. Each observation represents a one year of several variables of financial data for one firm. However, while one firm may have an observation for a given ...
Ayoze Alfageme's user avatar
0 votes
0 answers
25 views

Multicollinearity with interaction term and fixed effects

I have the following regression including an interaction term and fixed effects ...
metricshelpr's user avatar
1 vote
0 answers
35 views

How to find hourly wage when data only provide range?

I am trying to separate observations into two groups, people who earn below (treatment group) and above (control group) the minimum wage to perform a difference-in-differences. The data I'm using have ...
asdf's user avatar
  • 23
1 vote
1 answer
42 views

Plotting a variable over terciles

I am looking to create a figure using Stata, specifically a figure depicting the median change in financial constraints over the years, categorized by terciles of total assets and operating cash flow. ...
user282815's user avatar
2 votes
0 answers
44 views

Difficulties in translating my equations into R

I have calculated my own Solow model with energy as an input factor. I'm already pretty sure that the equations are correct but the problem I have are the results from the loop I build for the ...
EBger's user avatar
  • 21
1 vote
1 answer
110 views

Unit root tests in panel data

I'm currently engaged in a panel data analysis project in R, focusing on multiple economic variables (such as GDP, Gross Fixed Capital Formation, etc.) for EU27 countries spanning the period 1995-2015....
kostas2323's user avatar
2 votes
0 answers
83 views

Staggered difference-in-difference for binary outcome and time-to-outcome

I am trying to find out the effect of a training program for employees by answering 2 questions: Does taking training increase the probability of an employee getting promoted? Does taking training ...
yunchan's user avatar
  • 121
1 vote
0 answers
79 views

Testing Kaldor's Second Law

According to Kaldor's second law, as manufacturing industry grows, the productivity in manufacturing will increase: $$p_i=f(g_m)$$ And, from the article of Heather Wells and A.P. Thirlwall (Testing ...
Tunay Sabri Yüksel's user avatar
0 votes
1 answer
376 views

How to overcome the problem of duplicates in Panel data in R

I tried to convert my data to panel data but i kept experiencing an error message. The data is in the form of likert scale. The error message was duplicate couples (id-time) in resulting pdata.frame ...
musa's user avatar
  • 1
0 votes
1 answer
39 views

Assumptions of Logistic Regression Cathegorical predictors only

I have a logit model predicting the outcome 1 or 0. My predictors are sociodemographics such as gender, income - intervals into categories like a: 1000-5000 usd, b:5000-15000 usd. etc, having a car, ...
vojta9's user avatar
  • 15
1 vote
1 answer
57 views

Results Chi square test vs binomial logit

my data looks like this: I have two groups of people - Students and the elderly. 59 out of 266 students said "YES" 23 out of 127 elderly people said "YES" The rest said "no&...
vojta9's user avatar
  • 15
1 vote
0 answers
19 views

Estimating Share Coefficients of Utility Function for a Calibrated CGE

Been reading The Textbook of Computable General Equilibrium (CGE) by Hosoe et al as a bit of side interest later in life. Much of the book (and the CGE set-up generally) obviously follows naturally ...
EB3112's user avatar
  • 597
5 votes
2 answers
2k views

Parallel pretrends in Callaway Sant'Anna "did" event study package

I have noticed that in some of my event study regressions, depending on which R package I use I get different results regarding the violation of parallel pretrends. Specifically, I ran an event study ...
Oberberg's user avatar
3 votes
0 answers
277 views

TFP and the residual with prodest() package in r

I am estimating a firm level production function in R and I am using the prodest() package, which is the equivalent of the prodest package in Stata, written by the ...
Bob's user avatar
  • 81
1 vote
0 answers
93 views

Fixed effect model: different estimation approaches with R - how to demean variables - unbalanced panel

I want to use R to estimate a fixed effects model using different estimation approaches (e.g. replicating xtreg from Stata). Note that I am using an unbalanced panel. The easiest way to do this is ...
shazz's user avatar
  • 11
1 vote
0 answers
101 views

conleyreg() for panel data

With panel data, how does conleyreg() correct for spatial correlation and autocorrelation within units over time? More specifically, why do my standard errors change when I specify 'unit' and 'time' ...
Internet person's user avatar
1 vote
0 answers
101 views

R (splm): Is there any way to do an unbalanced panel estimation for spatial econometrics?

From what I know, splm package won't allow us to estimate unbalanced dataset on spatial econometrics (SAR, SEM, SDM). Is there any packages or solution to face ...
Daffa Rizqi Prayudya's user avatar
0 votes
1 answer
35 views

Adding a subscripts for P (price) in equation

I made the following equation for a hedonic model. When I sent it to my teacher to check if it was fine, she told me that I should add subscripts for P so that we know by what it varies. I don't get ...
whoknows's user avatar
1 vote
1 answer
45 views

Representing the Results of Panel with Three Dimensions

I have a panel with three dimensions: country, industry and year. For each country within my sample (c = 30), I am running a two-way fixed-effects model, where I add dummies for each year (t-1) and ...
Adrian's user avatar
  • 111
2 votes
1 answer
374 views

Functional form for regression in a hedonic pricing model

I am doing a regression where I use the hedonic pricing model. Hedonic pricing treats a marketed good, usually a house, as a sum of individual goods (characteristics or attributes) that cannot be sold ...
whoknows's user avatar
-1 votes
1 answer
56 views

Best way to fix the assumptions in linear regression with cryptocurrency data?

Hi I'm doing my undergraduate thesis, I want to predict closing price of Bitcoin using linear regression model, So i check the assumption using R then It is all not satisfied, so I want to fix It but ...
Paul Kionesala's user avatar
4 votes
2 answers
187 views

Journal that sum up a research area

I would like to know if you know any scientific journal of economics that publishes meta-analysis, or that publish articles summary of a research area. For example I have seen in the past articles ...
BAL's user avatar
  • 457
1 vote
0 answers
29 views

How should a GARCH (1,1) model look like?

I have a question regarding the GARCH (1,1) model. I have used R to forecast the volatility of some assets. I then plotted the forecasted volatility and the realized volatility on the same plot to see ...
TilManG4's user avatar
-1 votes
1 answer
231 views

Did Russia's GDP per capita really fall 38% between 2013 and 2020?

GPD per capita usually goes up over time due to improvements in technology, but Russia's fell dramatically from \$16,000 to \$10,000 in the 7 years from 20131. There was little change in Russia's ...
stevec's user avatar
  • 671
0 votes
0 answers
85 views

Replicate Goldman Sachs' US Financial Condition Index

I am trying to replicate Goldman Sachs' Financial Condition Index for the US. Has anyone done something similar and could help me? Thank you! This is the data description: (i) Policy Rate (4,4% weight)...
Amanda Restom de Castro's user avatar
3 votes
0 answers
57 views

How to read Sala-i-Martin datasets?

I found the datasets used in Barro and Sala-i-Martin's papers from the early 1990s. I have no idea how these could be read to either Stata or R. The file formats are .h, .wf , .wk1 and .wk4. I believe ...
erik's user avatar
  • 721
0 votes
1 answer
180 views

Why there is only one value of confidence interval?

As we know, we can calculate the confidence interval relating to standard errors and coefficients by that to get the high CIs and low CIs at 95% confidence interval Confident interval +/- standard ...
Nguyen Lis's user avatar
3 votes
0 answers
122 views

GMM Estimation with HAC Weight Matrix in R

I am currently working on my econometrics assignment regarding a seminal paper of John Taylor (1993) and really got stuck during the last days with one specific question. I am supposed to set up a GMM ...
jotheta's user avatar
  • 31
0 votes
1 answer
111 views

How to estimate a system of equations with missing values in dependent variable with sureg?

I am trying to estimate vote shares of different parties. So, suppose I have 4 parties, each having its own column in the data set. Hence, the sum would be tending to 1. Now, if a party does not ...
Anisha Garg's user avatar
3 votes
1 answer
100 views

How to recognize correlation in spurious regression case

Assume we are given two independent random walks $$ Y_t = Y_{t-1} + \varepsilon_{1, t}, \quad \varepsilon_{1, t} \sim \mathcal{N}(0, 1) \\ X_t = X_{t-1} + \varepsilon_{2, t}, \quad \varepsilon_{2, t} \...
Hyperbolic PDE friend's user avatar
0 votes
0 answers
73 views

Stochastic Optimization

I am working on a Data Panel project that is about macro volatility, taking into consideration some quality indicators. According to my model, indicators definitely determine macro variables. Data are ...
David K's user avatar
  • 21
0 votes
1 answer
457 views

Interpreting an ADF test in R

Although being a mathematician, I am fairly new to time series and R. On an assignment I was being asked to check a time series for stationarity in R, only using the $\texttt{adf.test}$ function that ...
Hyperbolic PDE friend's user avatar
3 votes
0 answers
446 views

How to estimate an SUR model in R with fixed effects and clustered standard errors?

I want to estimate an SUR (Seemingly Unrelated Regressions) model. I tried using systemfit and its wrapper Zelig. But I am not ...
Anisha Garg's user avatar
2 votes
1 answer
768 views

Why does pgmm function gives error every time?

I want to use the pgmm function in R with a lag of 1, but I get the following error everytime: ...
Lovemydogsxx's user avatar
1 vote
2 answers
339 views

Solving a system of equations using R

I'm trying to use R for my Macro practise and model solve for the equilibrium price where the inverse demand curve PD(q) and supply curve P. How do i do this? Thanks!
user avatar
1 vote
0 answers
73 views

Detrending multiplicative model

I have a GDP quarterly series and IND.P monthly series, which I need to detrend. I am following Bernanke et al. paper from 1995 and the way they do it is: ...
NotaNewUser's user avatar
7 votes
1 answer
482 views

Replicate Blundell and Bond (2000) results using R

I want to replicate Blundell and Bond (2000) Table III in R. I'm using the function pgmm from package plm, which (apparently) ...
antifrax's user avatar
  • 101
3 votes
0 answers
50 views

Extract residuals from Uhlig's rejection method - Lag selection

I wanna determine the number of lags for a Baysian VAR/FAVAR model, which I implement based on R's VARsignR package. To compute the AIC/BIC I'd need the residuals of the model estimation. How can I ...
HPMinsky's user avatar
2 votes
0 answers
57 views

Additive or multiplicative decomposing?

I am going to decompose one of my time series. My goal is to get rid of the seasonal component. It looks like this: The last picture is: log(next value/present value) I have understood that if the ...
schix's user avatar
  • 41
2 votes
0 answers
70 views

Remove seasonality in R

I have data of total exports of fish from my country in the time period 2010-2020. Since our currency (NOK) has gotten weaker to the currencies we are trading with, we have gotten a lot more value ...
schix's user avatar
  • 41
0 votes
1 answer
143 views

How to estimate a model by pooled OLS when we DO NOT have panel data?

The data set is mostly binary with years and location. We have a linear probability model. We DO NOT have panel data. How to estimate this model in R by Pooled OLS? Again, we DO NOT have panel data.
Jack's user avatar
  • 1
1 vote
1 answer
405 views

pdynmc package in R | GMM issue

I am a student, currently working on my Bachelor's Thesis. And as the next deadline approaches, I hope someone could give me a hand on my constant issue: I need to estimate the next model with GMM ...
Wadim iLchuk's user avatar
3 votes
0 answers
307 views

Arellano and Bond (1991) GMM estimation in R by using plm package

I am a last-year student at university, currently working on my Bachelor's (so still learning R), and I really hope that you would suggest a potential solution (even if to use Python). So, the main ...
Wadim iLchuk's user avatar
1 vote
0 answers
82 views

How can I add a multidimensional panel to estimate TFP (year, id, region) in R?

I'm not sure about adding fixed effects for the variables year,id,region (using the estprod library) as in this paper using LP stimator. In the STATA forum ( #18 #...
cdcarrion's user avatar
  • 123
0 votes
1 answer
206 views

Unbalanced panel data in prodest package in R

I have a question regarding the usage of unbalanced panel data for TFP estimation by using the prodest package. The dataset could be found here: https://drive.google.com/file/d/...
Wadim iLchuk's user avatar
0 votes
0 answers
105 views

How to calculate semi elasticity in fixed effect model with interaction

Given the model specification $$Y_{it} = \beta_1 X_{it} + \beta_2 D*X_{it} + FE_{i} + e_{it}$$ The above model specification is a Fixed effect model with interaction term ($X_{it}$ interacting with D- ...
EI_Otoakhia's user avatar