Quantcast
Channel: Statalist
Viewing all 65147 articles
Browse latest View live

Creating sum over groups/key

$
0
0
Hello everybody,

I am working on a dataset right now and need to know a simple thing. The dataset looks roughly like this:
votes key
5 1
7 1
2 1
4 2
6 2
8 2
3 3
8 3
9 3
As you might have guessed I want to sum all votes with the same key and generate a new variable with as many rows as i have individual keys (in this case 3 rows):
votes key
14 1
18 2
20 3
using "egen votes2 = sum(votes), by(key)" I receive the original number of rows and the sum repeatedly.

I am kinda confused even though it probably is very easy to solve.

greetings
Felix

Sign flip after using Instrument variable

$
0
0
Hi Statalist,

I met a problem when I was using the IV approach to estimate an equation, I am using Stata 14 and ivreg2.

The equation takes the following form:

y=c+a*X1+b*X2+eps

and I instrument X1 with Z.

After doing the IVreg2, the coefficient a has the same sign as OLS but coefficient b flips to the opposite sign.

What could this suggest? or why would this happen?

Best
Xu

name conflict error after running collapse command

$
0
0
Hi,
After running the below collapse command, I got an error on the name conflict (pasted below). Why is this for?

foreach v of varlist TLE_ HLE_ PLE_ trim* exceeds* {
local l "`l' (count) count`v'=`v' (mean) mean`v'=`v' (min) min`v'=`v' (max) max`v'=`v' "
}

collapse `l', by(Age_Group_ sample_label)

error:
countTLE_ = (count) TLE_
countTLE_ = (count) TLE_
name conflict

Policy change within the policy - triple difference analysis

$
0
0
Hi everyone,

I am trying to evaluate a policy that was implemented in 2007 in the US to stimulate research and development (R&D) for specific diseases. The policy was implemented in a staggered way: most diseases became eligible for the policy in 2007, but a few others became eligible in 2014, 2015, 2016 and 2018. My dependent variable is the sum of yearly trial registratrion per disease and registry. Since the policy targets a specific registry (ClinicalTrials.gov) and specific diseases, I isolate the impact of the policy using a triple difference approach. To do so, I use the below data and run the following specification:

Code:
egen regist_disease=concat(registry disease)
encode regist_disease, gen (registry_disease)
xtset registry_disease year

xtpoisson trials afterr##US##eligible afterr##US user_fee_lag1 dalys i.year, fe vce(robust)
margins afterr#US, dydx(eligible) pwcompare predict(nu0)
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float trials long registry str35 disease int year float(afterr US eligible user_fee_lag1 dalys after_user)
 0 10 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
10  5 "Ischemic heart disease" 2017 1 1 0 0 .08415308 1
 0 16 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0 18 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0  1 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0  2 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0 15 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0 17 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0 12 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 2  3 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0  9 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0  4 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0 11 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0  7 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 1  8 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0 14 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 1  6 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0 13 "Ischemic heart disease" 2017 1 0 0 0 .08415308 1
 0  9 "Ischemic heart disease" 2012 1 0 0 0 .08102311 1
 0  1 "Ischemic heart disease" 2009 1 0 0 0 .07826114 0
 0 18 "Ischemic heart disease" 2019 1 0 0 0 .08481748 1
 0 14 "Ischemic heart disease" 2018 1 0 0 0 .08481748 1
 0 10 "Ischemic heart disease" 2006 0 0 0 0  .0758043 0
 2  6 "Ischemic heart disease" 2018 1 0 0 0 .08481748 1
 0  3 "Ischemic heart disease" 2011 1 0 0 0 .08027124 1
 0  2 "Ischemic heart disease" 2010 1 0 0 0 .07976772 0
 0 15 "Ischemic heart disease" 2006 0 0 0 0  .0758043 0
 0 13 "Ischemic heart disease" 2005 0 0 0 0 .07648688 0
 3  5 "Ischemic heart disease" 2012 1 1 0 0 .08102311 1
 0 17 "Ischemic heart disease" 2012 1 0 0 0 .08102311 1
 1  3 "Ischemic heart disease" 2018 1 0 0 0 .08481748 1
 0 13 "Ischemic heart disease" 2008 1 0 0 0 .07690977 0
 0  2 "Ischemic heart disease" 2013 1 0 0 0  .0814804 1
 0  2 "Ischemic heart disease" 2019 1 0 0 0 .08481748 1
 0 11 "Ischemic heart disease" 2006 0 0 0 0  .0758043 0
 0 17 "Ischemic heart disease" 2014 1 0 0 0 .08249104 1
 0 11 "Ischemic heart disease" 2016 1 0 0 0 .08412416 1
 0 18 "Ischemic heart disease" 2016 1 0 0 0 .08412416 1
 0  3 "Ischemic heart disease" 2016 1 0 0 0 .08412416 1
 2  6 "Ischemic heart disease" 2005 0 0 0 0 .07648688 0
 0 14 "Ischemic heart disease" 2016 1 0 0 0 .08412416 1
 0  7 "Ischemic heart disease" 2006 0 0 0 0  .0758043 0
 0  4 "Ischemic heart disease" 2016 1 0 0 0 .08412416 1
 0 17 "Ischemic heart disease" 2005 0 0 0 0 .07648688 0
 0  3 "Ischemic heart disease" 2005 0 0 0 0 .07648688 0
 0 15 "Ischemic heart disease" 2016 1 0 0 0 .08412416 1
 0 12 "Ischemic heart disease" 2015 1 0 0 0  .0837075 1
 0 15 "Ischemic heart disease" 2014 1 0 0 0 .08249104 1
 0 15 "Ischemic heart disease" 2015 1 0 0 0  .0837075 1
 0 11 "Ischemic heart disease" 2009 1 0 0 0 .07826114 0
 0  1 "Ischemic heart disease" 2012 1 0 0 0 .08102311 1
 6  5 "Ischemic heart disease" 2005 0 1 0 0 .07648688 0
 1  1 "Ischemic heart disease" 2006 0 0 0 0  .0758043 0
 0  9 "Ischemic heart disease" 2011 1 0 0 0 .08027124 1
 0  2 "Ischemic heart disease" 2009 1 0 0 0 .07826114 0
 0  4 "Ischemic heart disease" 2008 1 0 0 0 .07690977 0
 0  1 "Ischemic heart disease" 2015 1 0 0 0  .0837075 1
 0 10 "Ischemic heart disease" 2014 1 0 0 0 .08249104 1
 0  2 "Ischemic heart disease" 2018 1 0 0 0 .08481748 1
 0 13 "Ischemic heart disease" 2014 1 0 0 0 .08249104 1
 1  1 "Ischemic heart disease" 2010 1 0 0 0 .07976772 0
 2  1 "Ischemic heart disease" 2014 1 0 0 0 .08249104 1
 0 12 "Ischemic heart disease" 2012 1 0 0 0 .08102311 1
 0  9 "Ischemic heart disease" 2010 1 0 0 0 .07976772 0
 0  9 "Ischemic heart disease" 2018 1 0 0 0 .08481748 1
 0  4 "Ischemic heart disease" 2006 0 0 0 0  .0758043 0
 0  9 "Ischemic heart disease" 2019 1 0 0 0 .08481748 1
 0 17 "Ischemic heart disease" 2010 1 0 0 0 .07976772 0
 0  7 "Ischemic heart disease" 2008 1 0 0 0 .07690977 0
 9  5 "Ischemic heart disease" 2016 1 1 0 0 .08412416 1
 3  8 "Ischemic heart disease" 2014 1 0 0 0 .08249104 1
 0 16 "Ischemic heart disease" 2013 1 0 0 0  .0814804 1
 0 15 "Ischemic heart disease" 2018 1 0 0 0 .08481748 1
 0 18 "Ischemic heart disease" 2007 1 0 0 0   .075984 0
 0 11 "Ischemic heart disease" 2013 1 0 0 0  .0814804 1
 2  8 "Ischemic heart disease" 2012 1 0 0 0 .08102311 1
 2  1 "Ischemic heart disease" 2018 1 0 0 0 .08481748 1
 0 12 "Ischemic heart disease" 2018 1 0 0 0 .08481748 1
 0  7 "Ischemic heart disease" 2009 1 0 0 0 .07826114 0
 0 11 "Ischemic heart disease" 2010 1 0 0 0 .07976772 0
 0  8 "Ischemic heart disease" 2009 1 0 0 0 .07826114 0
 0 12 "Ischemic heart disease" 2008 1 0 0 0 .07690977 0
 0  1 "Ischemic heart disease" 2011 1 0 0 0 .08027124 1
 3  8 "Ischemic heart disease" 2018 1 0 0 0 .08481748 1
 0  3 "Ischemic heart disease" 2014 1 0 0 0 .08249104 1
 0 11 "Ischemic heart disease" 2019 1 0 0 0 .08481748 1
 1  8 "Ischemic heart disease" 2013 1 0 0 0  .0814804 1
 0  6 "Ischemic heart disease" 2016 1 0 0 0 .08412416 1
 0  7 "Ischemic heart disease" 2015 1 0 0 0  .0837075 1
 6  5 "Ischemic heart disease" 2011 1 1 0 0 .08027124 1
 0  1 "Ischemic heart disease" 2005 0 0 0 0 .07648688 0
 0  7 "Ischemic heart disease" 2014 1 0 0 0 .08249104 1
 0  4 "Ischemic heart disease" 2012 1 0 0 0 .08102311 1
 0  4 "Ischemic heart disease" 2005 0 0 0 0 .07648688 0
 0 17 "Ischemic heart disease" 2009 1 0 0 0 .07826114 0
 2  5 "Ischemic heart disease" 2006 0 1 0 0  .0758043 0
 0  7 "Ischemic heart disease" 2012 1 0 0 0 .08102311 1
 2  6 "Ischemic heart disease" 2015 1 0 0 0  .0837075 1
 1  6 "Ischemic heart disease" 2012 1 0 0 0 .08102311 1
 0  7 "Ischemic heart disease" 2019 1 0 0 0 .08481748 1
end
label values registry registry
label def registry 1 "ANZCTR", modify
label def registry 2 "CRIS", modify
label def registry 3 "CTRI", modify
label def registry 4 "ChiCTR", modify
label def registry 5 "ClinicalTrials.gov", modify
label def registry 6 "EU Clinical Trials Register", modify
label def registry 7 "German Clinical Trials Register", modify
label def registry 8 "IRCT", modify
label def registry 9 "ISRCTN", modify
label def registry 10 "JPRN", modify
label def registry 11 "LBCTR", modify
label def registry 12 "Netherlands Trial Register", modify
label def registry 13 "PACTR", modify
label def registry 14 "REBEC", modify
label def registry 15 "REPEC", modify
label def registry 16 "RPCEC", modify
label def registry 17 "SLCTR", modify
label def registry 18 "TCTR", modify
In 2011, a change was made to the policy with the implementation of a user fee: the policy was no longer free for companies to apply. The value of the user fee has been fluctuating annually since its implementation 2011. To control for this policy change within my policy, I initially included the variable user fee "user_fee_lag1" as a control variable in my regression. However, I have been told that it should be included as part of my policy variable. To do so, I have created a new after variable "after_user" that takes the value of 1 from 2011 onwards and I interacted it with the treated registry and diseases. Does this sound correct to you? Is it an issue if my two after variables ("afterr" and "after_user") overlap?

Code:
xtpoisson trials afterr##US##eligible afterr##US after_user##US##eligible dalys i.year, fe vce(robust)
Any help would be greatly appreciated! Thank you very much in advance!

“if” command after mutiple-imputated variable

$
0
0
Dear Members,

Could anyone please to advice on a problem in mutiple-imputated dataset. I have a variable called "hypertension" with serval missng values. Hence, I performed a mutiple imputation on this with 25 imputation sets. Recently, I want to run an mixed effect model with restrition like "if" command to restrict to those with hypertension participants. However, I could not use
Code:
if hyoertension==1
after "mi estiamte" right? it will not count for the mutiple imputated vaule of the hypertension right? So, If there is anyway to perform this restrict and acount for imputated vaule of the hypertension variable?? Many Thanks!!

All the best,

Roth

How to use AR(8) model to forecast

$
0
0
I was given an assighment to use a dataset contains quarterly unemployment rate data from 1957:q1-2013:q4.The question is to use AR(8) model to forecast unemploymen rate of change in 2012:q4-2013:q1.Here is my command,however it went wrong when I tried to use forvalue loop. And also the twoway tsline just have one actual line, there also should be a forecast line. Masters could you please give some suggestions on my command?

tsset quarter, quarterly

gen unrate1=ln(unrate)

gen deltaunrate=400*(ln(unrate)-ln(L.unrate))

capture drop deltaunrate_f

gen deltaunrate_f=.

forvalues t=`=tq(1957q1)'/`=tq(2012q4)' {

quietly {

regress deltaunrate L(1/8).deltaunrate L(1/8).if quarter>=tq(1957q1) & quarter<=`t'-1


Predict fitted

replace deltaunrate_f=fitted if quarter==`t'

drop fitted
}
}

twoway tsline deltaunrate deltaunrate_f if tin(1957q1,2012q4), legend(order(1 "actual unemployment rate" 2 "forecast unemployment rate")) aspectratio(0.5)
Array

More efficient way of writing a repetitive expression

$
0
0
Hi all,

Is there a way to write the following code more efficiently?
Code:
keep if var1==1 | var2==1 | var3==1 | var4==1 | var5==1
Say I have 99 variables rather than 5. I feel like there must be a better way to do this than typing out an expression with all 99 variables. Could I perhaps use some kind of loop to do the following?
Code:
keep if forval i=1/99 "union of" {
var`i'==1
}
Thank you,
Terrence

Changing date from Str9 to Float

$
0
0
I am currently trying to change the format of a date variable from a str9 to a float and I am getting a type mismatch error. I was able to successfully change my first variable that was not a str9. Can anyone help me with this? STATA also says, "string %fmt required for string variables", but it will not let me destring this variable.

The dates are currently reading like "30-Oct-12" and I need them to read "30oct2012"
. gen endA = dofc(Date_A)
type mismatch
r(109);
Thanks!

etregress with panel data

$
0
0
Hello,

I have a general question: Is the command etregress appropriate for panel data? Thank you, Michael.

Outreg2 error r(915)

$
0
0
Hello Community,

I would like to prepare a word output with summary statistics of some variables in my sample using the outreg2 package. I am specifically interested in listing the following statistics per variable: N mean SD p5 median p95.

For this purpose I am using the following command:
Code:
outreg2 using Descriptive.doc, replace sum(detail) keep(var_1 var_2 ... var_x) eqkeep(N mean sd p5 p50 p95)
It runs the detailed statistics for all variables smoothly but then runs into an error. It states that (error r(915)):
unable to allocate matrix;
You have attempted to create a matrix with too many rows or columns or attempted to fit a model with too many variables.

You are using Stata/IC which supports matrices with up to 800 rows or columns. See limits for how many more rows and columns Stata/SE and Stata/MP can support.

If you are using factor variables and included an interaction that has lots of missing cells, try set emptycells drop to reduce the required matrix size; see help set emptycells.

If you are using factor variables, you might have accidentally treated a continuous variable as a categorical, resulting in lots of categories. Use the c. operator on such variables.
I don't know why this should be a limit issue since I tried outputting only one variable, and it still runs into this error. The same command with a different dataset works fine, and so does the
Code:
sum(log)
option with my dataset. I also tried again the
Code:
summarize, detail
, and it runs without any errors for all variables. Is there anything that I am wrongly specifying in the code or any workaround?

Any help would be much appreciated!

Reshape dataset

$
0
0
Dear Stata Users,

I have the following data. Job1 and Job2 represent the monthly dates of the beginning of ID's first and second job.
Jobe1 and Jobe2 represent the monthly dates of the end of ID's first and second job.

input int ID float(job1 jobe1 job2 jobe2)
430 517 540 542 .
431 452 457 466 509
432 557 560 572 .
433 49 62 71 115
434 82 105 105 123
435 . . . .
436 410 537 537 568

I need to restructure the dataset, such that I have a long form dataset with an equal number of observations for each ID.
I would like to follow those observations within a specifc time period, let's say months 516-550

In the end the dataset should be the following

ID time Job1 Jobe1 Job2 jobe2 Occupational status

430 516 517 540 542 . Unemployed
430 517 517 540 542 . Employed
430 518 517 540 542 . Employed
....
430 542 517 540 542 . Umployed
430 543 517 540 542 . Employed
....
430 550 517 542 Employed

431 516 452 457 466 509 Unemployed
...

431 550 452 457 466 509 Unemployed
...

I am looking for suggestions on how to reshape this dataset (maybe cross or expand)?
Thank you very much

Test total effect after regression with interaction term.

$
0
0
Hello everyone,

After a mixed-effect model with an interaction term, I am trying to use -test- to compare the total effect (_b[exposure]+_b[exposure#covar]) vs the interaction-free effect. Also, I would like test if both coefficients are different than 0. However, I'm unsure if the output is what I was looking for. I would appreciate some help. I use Stata 14.2

More specifically, I have a biomarker measured at 3 age-points and exposure to NO2. I would like to determine with exposure to NO2 affects the biomarker level overall (repeated measure) and at the 3 age-points (not continuous). ID is the unique number for every individuals. The data is in long format
code:
Code:
 
.mixed biomarker c.NO2##i.age || ID: 
(output omitted)

.test _b[NO2] = _b[NO2] + _b[1.age#c.NO2] = _b[NO2] + _b[2.age#c.NO2] = 0   

 ( 1)  - [biomarker]1.age#c.NO2 = 0
 ( 2)  - [biomarker]2.age#c.NO2 = 0
 ( 3)  [biomarker]NO2 = 0

           chi2(  3) =   13.29
         Prob > chi2 =    0.0040
Is this -test- indeed considering the total effect? I'm unsure if the output:
" ( 1) - [biomarker]1.age#c.NO2 = 0"
really means what I intended:
"biomarker]NO2 + [biomarker]1.age#c.NO2 = 0"

Am I not writing the -test- correctly?

Difference -in-difference research design and endogeneity issue

$
0
0
Hi all!

I want to address the endogeneity issue in my paper.

I have panel data (gvkey and fyear). I create RTW indicator for states that adopted RTW laws.

I also create ChangeRTW to construct a treatment variable, which is a dummy taking the value of one if the firm (gvkey) is located in a certain state which will adopt RTW during my sample period (many states have already adopted this law before my sample period). I then create a dummy, Post, which is one after the adoption year.

For those states that already adopted this law:
gen RTW=state=="AL"|state=="AZ"|state=="AR"|state=="FL "|state=="GA"|state=="ID"|state=="IA"|state==" KS"| state=="LA"|state=="MS"|state=="NE"|state=="NV"|st ate=="NC"|state=="ND"|state=="OK"|state=="SC"|stat e=="SD"|state=="TN"|state=="TX"|state=="UT"|state = ="VA"|state=="WY"

For the states that adopt this law during my sample period:
replace RTW=1 if state=="IN" & fyear>2011
replace RTW=1 if state=="MI" & fyear>2011

gen ChangeRTW=state=="IN"|state=="MI"
gen Post=fyear>2011 if state=="IN"|state=="MI" (##not sure if I should use this instead: Post=fyear>2011)
replace Post=0 if Post==.

What are the best ways to create this difference in difference regression? Should I use something like the following one?

reg DependentVar ChangeRTW*Post*IndependentVar ChangeRTW Post IndependentVar Controls (model 1)

or reg DependentVar RTW*IndependentVar RTW IndependentVar Controls (model 2)


The results using model 1: I have three sets of statistics under ChangeRTW*Post*IndependentVar, 0 0; 1 0 ; 1 1. But the stats for 1 0 is empty. Why do I get this empty stats?

Similarly, the results using model 2: two sets of stats under RTW*IndependentVar, 0 and 1, but empty stats in the 1 group. Anyone can help me understand this issue?


Any advice on how to address the endogeneity issue or how to use difference-in-difference will be greatly appreciated!

trouble choosing a STATA command for the data set

$
0
0
The variables present are:
- ID : observation
- Recurrent: binary, if cancer came back; 0=did not come back, 1= did come back
- tumorsize: continuous, >2 = large, <=2 = small
The question being presented: divide patients into two groups, the ones who had recurrence and the ones didn’t have recurrence. Calculate the sample means and the sample standard deviations of the tumor sizes by group.

I am currently using the tabulate command for summary statistics for recurrent variable but am unsure how to go about grouping them together.

Compare variable lists between two datasets

$
0
0
Hello,

I'm using Stata 15.1. I want to compare variable lists between two datasets. It seems that cfvars by Kit Baum did this in Stata 9, but that this package is no longer available from ssc. I've searched for solutions, but I've only found suggestions to use cf, which compares variable values as opposed to just the variable lists between datasets. Any suggestions are appreciated.

how to add ci to graph bar with several variables

$
0
0
Hi!

I am trying to add CI to my bar graph, but can not figure it out. I have found several examples with one variable, but not with several. I would really appreciate some help. My graph currently looks like this Array

and code I used is the following
Code:
graph bar (mean) Openness_to_Reward15 OR_Excitement15 OR_Social_experience15 , over(TFAP2B15) over(sex15, relabel(1 "male" 2 "female")) ///
graphregion(color(white)) ///
legend(label(1 "Openness to Reward (OtR)") label(2 "OtR exitement and novelty") label(3 "OtR social experience") rows(3) region(lstyle(none))) ///
scheme(s1mono) ///
ytitle("reward sensitivity score", height (5)) ylabel (3(.25)4) exclude0 ///
title("TFAP2B effect on OtR ",ring(0) pos(12) size(medium))
graph save OtR_TFAP2B, replace

graph bar (mean) Insatiability_by_Reward15 IR_Excessive_spending15 IR_Giving_in_to_cravings15 , over(TFAP2B15) over(sex15, relabel(1 "male" 2 "female")) ///
scheme(s1mono) bar(1, ///  
fcolor(gs16)) bar(2, ///
fcolor(gs12)) bar(3, fcolor(black)) ///
legend (label(1 "Insatiability by Reward (IbR)") label(2 "IbR excessive spending") label(3 "IbR giving in to cravings")rows(3) region(lstyle(none))) ///
graphregion(color(white)) ///
ytitle("reward sensitivity score", height (5)) ylabel (2(.25)3) exclude0 ///
title("TFAP2B effect on IbR",ring(0) pos(12) size(medium))
graph save IbR_TFAP2B, replace

graph combine  OtR_TFAP2B.gph IbR_TFAP2B.gph,   imargin(small) scheme(s1color)
graph export RS_TFAP2B-1.tif, height(2100) width(2970)
Or should I approach it in a different way using something other that "graph bar"?

Kind regards,
Urmeli

Stata &quot;Pausing&quot; During Long-Running Process

$
0
0
Hi All,

I'm running a long-running do file that "paused" this morning. The UI still shows the "break" button but no new output has appeared in Results for hours.

Is there a way to get Stata to start running the do file again without ending the entire process?

FYI this happened after a computer power-off request was cancelled due to Mac OS being unable to close Stata.

Thank you

Interaction effect of two time-varying variables in fixed-effects regression

$
0
0
Hello,

I am analyzing panel data with two time periods in individual fixed-effects regression. My independent variable and moderator are both time-varying within each individual. The moderator has three levels. This is the code I used.

[xtreg depvar i.iv##i.moderator covariates, fe robust]

What I want to analyze is whether the effect of my independent variable (i.iv) on dependent variable varies across different levels of the moderator. What is confusing to me is the interpretation on the coefficient on the interaction term of i.iv and i.moderator, since the moderator is also time-variant within each individual. When the moderator is also time-varying, not time-invariant, what does the interaction term indicate?

Since the moderator has three levels, there are six different types of transitions (0-->1, 0-->2, 1-->0, 1-->2, 2-->0, 2-->1). Does the interaction term indicate whether the effect of within-individual change in the independent variable on the dependent variable varies across different within-individual changes in each type of transition of the moderator? If so, I'm still not sure what this interpretation means intuitively.

I'd appreciate if any of you can help me out in this problem!

Extraction of individual long-run coefficients xtdcce2 mg

$
0
0
Hi,

I am estimating an ECM model using xtdcce2 command, specifically I am applying (Dynamic) Common Correlated Effects Estimator - Mean Group to my model. Long-run mean group estimates are obtained by averaging individual cross-sectional coefficients. I would like to ask if there is a possibility/command to extract those individual long-run coefficients?

Thank you in advance for your reply!

Best,
Valeryia

Producing a scatterplot with bin size

$
0
0
I have a dataset with two variables, age (in years) and log wages (in euros). I am looking to produce a scatterplot of log wages against age with a bin size of 4 months.

An example of the first observation for age is 48.99178 years.

How should I proceed ahead?
Viewing all 65147 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>