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

Issues with Project Manager

$
0
0
I'm still checking on things to see if this might be a preferences thing with OSX, but when I use:

Code:
projmanager x.stpj
I am expecting the project manager to appear as part of the do-file editor. Instead, it seems the project manager is built into the pane where the results/command windows are located and a new window never opens. I'm not sure if this is potentially a bug or if the projmanager documentation needs to be updated, but I definitely appreciated being able to launch the do-file editor project manager from the command line.

How to run model with 3SLS, with fixed effects?

$
0
0
Hi All,


how to conduct the following model in stata? It's simultaneous equations with two way fixed effects.

two fixed effects: id and year

Two equations:

y1=x1+x2+x3+y2

y2=y1+x2+x3+y1




Thanks!


Estat Classification with melogit

$
0
0
Hello,
I'd like to know if there is an alternative for Estat Classification after melogit command.
Manual: "estat classification requires that the current estimation results be from logistic, logit, probit, or ivprobit"
Thank, regards

r(504) Missing matrix values error with metandi command

$
0
0
I am working on a meta-analysis of diagnostic test accuracy with metandi in Stata 14.2. I have included the data below (the number of true positives, false positives, false negatives, and true negatives for this particular diagnostic test from each of seven studies):

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str16 firstauthor byte tp float fp byte(fn tn)
"Derlin 2013"       5  3  5 18
"Sachpekidis 2015"  2  1  3  2
"Basha 2018"        6  2  2 12
"Cascini 2013"      7  4  2 16
"Zamagni 2007"      6  2  8  6
"Derlin 2012"      65 14 54 64
"Sager 2011"        1  0  1  8
end
The normal command to run metandi is:
Code:
metandi tp fp fn tn
When I try to run this command, Stata informs me that:
invsym(): matrix has missing values
r(504);
I have never received this error before and I am not sure what is causing it. I did run into a previous discussion on a similar problem, but I think the premise of that thread was incorrect (i.e., 0 false positives is not causing the error--correct me if I am wrong). Also the suggestion of forcing metandi to use gllamm instead of xtmelogit did not resolve the issue.

To try to understand what is going on under the hood to get this error, I ran the following command:
Code:
metandi tp fp fn tn, detail
This gave me the following output:
Refining starting values:

Iteration 0: log likelihood = -28.696589 (not concave)
Iteration 1: log likelihood = -26.381488 (not concave)
Iteration 2: log likelihood = -24.186128
Iteration 3: log likelihood = -23.026692

Performing gradient-based optimization:

Iteration 0: log likelihood = -23.026692
Iteration 1: log likelihood = -22.455397
Iteration 2: log likelihood = -22.443629
Iteration 3: log likelihood = -22.443627

Mixed-effects logistic regression Number of obs = 14
Binomial variable: _metandi_n
Group variable: _metandi_i Number of groups = 7

Obs per group:
min = 2
avg = 2.0
max = 2

Integration points = 5 Wald chi2(2) = 55.41
Log likelihood = -22.443627 Prob > chi2 = 0.0000

------------------------------------------------------------------------------
_metandi_t~e | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_metandi_d1 | .2043004 .1555728 1.31 0.189 -.1006167 .5092175
_metandi_d0 | 1.578185 .2154021 7.33 0.000 1.156005 2.000366
------------------------------------------------------------------------------

------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
_metandi_i: Unstructured |
sd(_metan~1) | 4.47e-08 .1778994 0 .
sd(_metan~0) | 7.12e-08 .2327559 0 .
corr(_metan~1,_metan~0) | -.1365545 1869501 -1 1
------------------------------------------------------------------------------
LR test vs. logistic model: chi2(3) = 0.00 Prob > chi2 = 1.0000

Note: LR test is conservative and provided only for reference.
invsym(): matrix has missing values
It appears the values for the upper-bound values for the 95% CI for the random-effect parameters are missing. I am unsure if this is what is causing the problem.


Please let me know if there is a way around the missing matrix values. I am able to get the pooled sensitivity and specificity (my outcome of interest) with
midas, but I prefer to do the analysis in metandi because it allows for proper modeling of the HSROC curve.

Best,
Sharath Rama

converting R code into Stata?

$
0
0
Is there something out there that could help me convert R code into Stata code? Someone shared with me a piece of R code that I could really use for a paper, but I don't speak R. Is there such a thing as an R-to-Stata code translator? (I think I saw something the other way around, which doesn't help me, sadly)

Multiple linear regression help

$
0
0
Hi



I am currently running multiple linear regression analyses.

The predictor variables that I am adding into regression are a mix of binary and continuous variables. My outcome variable is continuous.

I am wondering whether you can run a linear regression ok with mixed predictor variable types. i.e. one binary variable and one continuous variable used as the predictors?



Cheers

Paul


Difference in Differences with 3 time periods

$
0
0
Dear all,

I am currently analyzing the link between board gender diversity and firm performance. I have a panel data of 264 firms from the S&P500 over the 2006-2015 period. I have 3 periods: before (2006-2007), during (2008-2009) and after the Subprime Crisis (2010-2015)

It's my first time looking at the difference in differences analysis, I want to see the impact of firms which have more women compare to the firms with less women on their board of directors (before VS during the Crisis).

I am trying first to do 1) a difference in differences without fixed effects and without control variables, 2) differences in differences with fixed effects but without control variables and finally 3) differences in differences with fixed effect and control variables.

My main dependent variable is TOBINS'q (firm value) and my main independent variable is WOB (% of women on board). I create a dummy variable called Crisis (=1 if YEAR = 2008 & 2009, = 0 otherwise).

Questions:

1) If i am doing a difference in differences, it will show me the difference outside the crisis (pre and post crisis) and during the Crisis right? if i want to see only before and during, how should i do it and do you think it is better ?

2) Can i use a continuous variable in interaction with my Crisis dummy variable (c.WOB##i.Crisis) ? for now i used the command xtile to create a new variable WOB_quart which gives me 1 (firms with the less women),2 ,3 and 4 (which have the highest percentage of women), i used this new variable WOB_quart to create my dummy variable (WOB_dummy) which gives = 1 if WOB_quart = 4 (top quartile) and 0 if WOB_quart = 1 (bottom quartile)

I used the following command without FE and control variables :
Code:
 diff Q2ln_w, t(WOB_dummy) p(Crisis)

DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 1436
            Before         After    
   Control: 508            166         674
   Treated: 645            117         762
            1153           283
--------------------------------------------------------
 Outcome var.   | Q2ln_w  | S. Err. |   |t|   |  P>|t|
----------------+---------+---------+---------+---------
Before          |         |         |         |
   Control      | 0.535   |         |         |
   Treated      | 0.577   |         |         |
   Diff (T-C)   | 0.042   | 0.024   | 1.78    | 0.075*
After           |         |         |         |
   Control      | 0.329   |         |         |
   Treated      | 0.428   |         |         |
   Diff (T-C)   | 0.099   | 0.048   | 2.05    | 0.040**
                |         |         |         |
Diff-in-Diff    | 0.057   | 0.054   | 1.06    | 0.290
--------------------------------------------------------
R-square:    0.04
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1

.
I don't really know how to interpret the results:

Is it right to say that "before" the Crisis, the firms from the top quartile "treated" compare to the control group, have a positive effect and significant coefficient (better performance), and same for during the Crisis ("After"). However in general, the results from Diff-in-Diff : it's positive but insignificant effect ?


Code:
If i want to include fixed effect first and then adding control variable, should I use xtreg ?
xtreg Q2ln_w WOB_dummy##Crisis i.YEAR#SIC_group, fe
&
xtreg Q2ln_w WOB_dummy##Crisis [Control variables] i.YEAR#SIC_group, fe
Thanks a lot for your help!

Stephan

Time-series dataset with repeated values

$
0
0
Dear community!
I am conducting a research on public opinion combined with different survey rounds, and I want to declare my dataset to be time-series. However, Stata doesn't allow to do this due repeated time values.
The key feature is that each survey has different respondents and different years, which common for respondents from particular survey. Thus I have something as follows:

year . idno.
2002 123
2002 124
2002 125
2004 126
2004 138
2006 185
2006 ...
2006 (id values are different)

Could you help me please with my issue to declare my dataset to be time-series?

Kinds regards,

ID fixed effect error: factor variables may not contain noninteger values

$
0
0
Hi! I am running a ologit regression with ID fixed effect and get the error msg: factor variables may not contain noninteger values
My code is: ologit rating indep_var i.ID
My ID is a 10 digit long integer, and setting it to be the format %16.0f does not help. What should I do?

Scatter plot with fixed effects

$
0
0
I am trying to draw a scatter plot of two variables, after having taken into account fixed effects (state and year). The idea is to analyse the correlation between gonorrhea rates and broadband diffusion so that I ran the following regression

Code:
tsset state year
xtreg gonorrhea internet i.year, fe
Then I collected the residuals using

Code:
predict gonorrhea_res, e
and I plot the residuals against broadband by state running

Code:
scatter internet gonorrhea_res, by(state)
Is this the right way to proceed? I tried to follow some other sources but I am not 100% sure about the code I wrote here.

Extracting specific part of string variable conditional on another string variable

$
0
0
Hello Dear All,

I have been working on the Web of Science database and it contains author names and addresses. Here is an example created by the dataex

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str23 author strL address
"Abbasoglu Ozgoren, Ayse" "[Abbasoglu Ozgoren, Ayse; Ergocmen, Banu] Hacettepe Univ, Inst Populat Studies, Ankara, Turkey; [Tansel, Aysit] Middle East Tech Univ, Ankara, Turkey"
"Tansel, Aysit"           "[Abbasoglu Ozgoren, Ayse; Ergocmen, Banu] Hacettepe Univ, Inst Populat Studies, Ankara, Turkey; [Tansel, Aysit] Middle East Tech Univ, Ankara, Turkey"
end
As you could see there are two variables one for author one for address. However, inside of the address variable, there are more than one address because of the other authors. Therefore, I want to take for example the University conditional on the author name. As for my example, for Abbasoglu Ozgoren, Ayse, I want to have Hacettepe Univ, for Tansel, Aysit, I want to have Middle East Tech Univ.

Here is the last results I would like to create from the above example:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str23 author strL address
"Abbasoglu Ozgoren, Ayse" "Hacettepe Univ"      
"Tansel, Aysit"           "Middle East Tech Univ"
end

Thank you so much



Portfolio of uncorrelated instruments

$
0
0
I would appreciate hearing your views on whether solving the problem below is possible in STATA.

I am looking to find a portfolio of uncorrelated instruments. The portfolio should be as large as possible, from a population of 250 instruments available. Here "uncorrelated" refers to any correlation between -0.03 and 0.03.

The difficulty is that for each uncorrelated pair, I need to identify a third element which has low corr with either element in the pair, then add fourth, then fifth, etc. until I can no longer find any instruments to add. Doing this manually can take hours to process all the possible combinations, so I am hoping there is a STATA code that can achieve the result.

I attach a sample .csv file of 250 instruments with daily returns over last year.

Why I am getting a r199 error

$
0
0
Why is it when stata15 is used to draw sROC curve, it reminds me that command homogeni is unrecognized

R (199).The commands and data are as follows:

help midas.
midas tp fp fn tn, plot sroc (both)
command homogeni is unrecognized
r (199);
accession tp fp fn tn
GSE1 15 1 1 4
GSE2 13 6 2 9
GSE3 33 1 11 24
GSE4 38 28 2 12
GSE5 4 2 24 16
GSE6 22 1 8 18
GSE7 17 12 7 11
mir8 33 14 15 34
9 422 14 101 30

Thanks

Question about reshape

$
0
0
I am currently working with data on different universities' metrics over time and need to change my data from long to wide format. So for each university, I currently have hundreds of rows, each of which has a university, which metric is measured, the year of the measurement, and its value. I am running into a couple of problems which I'm hoping to get some help on.

First I tried the reshape command of course, but because the year and metric name are not unique (i.e. each university also has the same year and metric name), I am unable to use the reshape command as together year and metric name do not uniquely identify observations. Is there a way to fix this?

To get around the first problem, I realized I could just isolate each university (by copying them into a new session of Stata, for example) and then simply reshape each university's data individually because once a single university is isolated, the metric name and year do uniquely identify observations. I've run into a couple of problems with this method, too, however. First, because the university names were encoded string values, I am losing the string part of the data when I reshape (Harvard University becomes just a 1, or whatever the encoded value was). Second, this process obviously will take a lot of time given the number of universities I have in the data set.

Hope this is clear!

Here is a very small sample of my current data: (sorry the formatting isn't perfect I didn't know the command to export it here cleanly)

Name Value Metricdescription Issueyear SchoolID PublicPrivate
Washington and Lee University 10.6 Student/faculty ratio 2002 3163 Private
Washington and Lee University 11.1 Student/faculty ratio 2003 3163 Private
Washington and Lee University 10.8 Student/faculty ratio 2004 3163 Private
Washington and Lee University 10.4 Student/faculty ratio 2005 3163 Private
Washington and Lee University 11.7 Student/faculty ratio 2006 3163 Private
Washington and Lee University 10.5 Student/faculty ratio 2007 3163 Private
Washington and Lee University 9.8 Student/faculty ratio 2008 3163 Private
Washington and Lee University 10.6 Student/faculty ratio 2009 3163 Private
Washington and Lee University 9.5 Student/faculty ratio 2010 3163 Private
Washington and Lee University 9.4 Student/faculty ratio 2011 3163 Private
Washington and Lee University 9.5 Student/faculty ratio 2012 3163 Private
Washington and Lee University 9.5 Student/faculty ratio 2013 3163 Private
Washington and Lee University 10.2 Student/faculty ratio 2014 3163 Private
Washington and Lee University 10.7 Student/faculty ratio 2015 3163 Private
Washington and Lee University 8.5 Student/faculty ratio 2016 3163 Private
Washington and Lee University 8.9 Student/faculty ratio 2017 3163 Private
Washington and Lee University 8.7 Student/faculty ratio 2018 3163 Private
Washington and Lee University 5.7 Student/faculty ratio 2019 3163 Private
Washington and Lee University 6.9 Student/faculty ratio 2020 3163 Private
Washington and Lee University Bar Passage rank 1994 3163 Private
Washington and Lee University Bar Passage rank 1995 3163 Private
Washington and Lee University Bar Passage rank 1996 3163 Private
Washington and Lee University Bar Passage rank 1997 3163 Private
Washington and Lee University Bar Passage rank 1998 3163 Private
Washington and Lee University Bar Passage rank 1999 3163 Private
Washington and Lee University Bar Passage rank 2000 3163 Private
Washington and Lee University Bar Passage rank 2001 3163 Private
Washington and Lee University Bar Passage rank 2002 3163 Private
Washington and Lee University Bar Passage rank 2003 3163 Private
Washington and Lee University Bar Passage rank 2004 3163 Private
Washington and Lee University Bar Passage rank 2005 3163 Private
Washington and Lee University Bar Passage rank 2006 3163 Private
Washington and Lee University Bar Passage rank 2007 3163 Private
Washington and Lee University Bar Passage rank 2008 3163 Private
Washington and Lee University Bar Passage rank 2009 3163 Private
Washington and Lee University 52 Bar Passage rank 2010 3163 Private
Washington and Lee University 117 Bar Passage rank 2011 3163 Private
Washington and Lee University 93 Bar Passage rank 2012 3163 Private
Washington and Lee University 175 Bar Passage rank 2013 3163 Private
Washington and Lee University 21 Bar Passage rank 2014 3163 Private
Washington and Lee University 177 Bar Passage rank 2015 3163 Private
Washington and Lee University 113 Bar Passage rank 2016 3163 Private
Washington and Lee University 26 Bar Passage rank 2017 3163 Private
Washington and Lee University 29 Bar Passage rank 2018 3163 Private
Washington and Lee University 66 Bar Passage rank 2019 3163 Private
Washington and Lee University 59 Bar Passage rank 2020 3163 Private
Yale University Acceptance rate 1994 3027 Private
Yale University Acceptance rate 1995 3027 Private
Yale University Acceptance rate 1996 3027 Private
Yale University Acceptance rate 1997 3027 Private
Yale University Acceptance rate 1998 3027 Private
Yale University Acceptance rate 1999 3027 Private
Yale University Acceptance rate 2000 3027 Private
Yale University Acceptance rate 2001 3027 Private
Yale University Acceptance rate 2002 3027 Private
Yale University Acceptance rate 2003 3027 Private
Yale University Acceptance rate 2004 3027 Private
Yale University Acceptance rate 2005 3027 Private
Yale University Acceptance rate 2006 3027 Private
Yale University Acceptance rate 2007 3027 Private
Yale University Acceptance rate 2008 3027 Private
Yale University Acceptance rate 2009 3027 Private
Yale University 7.6551946 Acceptance rate 2010 3027 Private
Yale University 8.0285459 Acceptance rate 2011 3027 Private
Yale University 6.7158283 Acceptance rate 2012 3027 Private
Yale University 7.9420107 Acceptance rate 2013 3027 Private
Yale University 8.3248386 Acceptance rate 2014 3027 Private
Yale University 9.3667046 Acceptance rate 2015 3027 Private
Yale University 8.9192025 Acceptance rate 2016 3027 Private
Yale University 9.7217203 Acceptance rate 2017 3027 Private
Yale University 9.4698355 Acceptance rate 2018 3027 Private
Yale University 8.3857442 Acceptance rate 2019 3027 Private
Yale University 6.852865 Acceptance rate 2020 3027 Private
Yale University Bar Passage rank 1994 3027 Private
Yale University Bar Passage rank 1995 3027 Private
Yale University Bar Passage rank 1996 3027 Private
Yale University Bar Passage rank 1997 3027 Private
Yale University Bar Passage rank 1998 3027 Private
Yale University Bar Passage rank 1999 3027 Private
Yale University Bar Passage rank 2000 3027 Private
Yale University Bar Passage rank 2001 3027 Private
Yale University Bar Passage rank 2002 3027 Private
Yale University Bar Passage rank 2003 3027 Private
Yale University Bar Passage rank 2004 3027 Private
Yale University Bar Passage rank 2005 3027 Private
Yale University Bar Passage rank 2006 3027 Private
Yale University Bar Passage rank 2007 3027 Private
Yale University Bar Passage rank 2008 3027 Private
Yale University Bar Passage rank 2009 3027 Private
Yale University 20 Bar Passage rank 2010 3027 Private
Yale University 16 Bar Passage rank 2011 3027 Private
Yale University 20 Bar Passage rank 2012 3027 Private
Yale University 8 Bar Passage rank 2013 3027 Private
Yale University 8 Bar Passage rank 2014 3027 Private
Yale University 12 Bar Passage rank 2015 3027 Private
Yale University 7 Bar Passage rank 2016 3027 Private
Yale University 10 Bar Passage rank 2017 3027 Private
Yale University 5 Bar Passage rank 2018 3027 Private
Yale University 8 Bar Passage rank 2019 3027 Private
Yale University 12 Bar Passage rank 2020 3027 Private
Arizona Summit Law School Acceptance rate 1994 3197 Private
Arizona Summit Law School Acceptance rate 1995 3197 Private
Arizona Summit Law School Acceptance rate 1996 3197 Private
Arizona Summit Law School Acceptance rate 1997 3197 Private
Arizona Summit Law School Acceptance rate 1998 3197 Private
Arizona Summit Law School Acceptance rate 1999 3197 Private
Arizona Summit Law School Acceptance rate 2000 3197 Private
Arizona Summit Law School Acceptance rate 2001 3197 Private
Arizona Summit Law School Acceptance rate 2002 3197 Private
Arizona Summit Law School Acceptance rate 2003 3197 Private
Arizona Summit Law School Acceptance rate 2004 3197 Private
Arizona Summit Law School Acceptance rate 2005 3197 Private
Arizona Summit Law School Acceptance rate 2006 3197 Private
Arizona Summit Law School Acceptance rate 2007 3197 Private
Arizona Summit Law School Acceptance rate 2008 3197 Private
Arizona Summit Law School Acceptance rate 2009 3197 Private
Arizona Summit Law School 67.445365 Acceptance rate 2010 3197 Private
Arizona Summit Law School Acceptance rate 2011 3197 Private
Arizona Summit Law School 69.650817 Acceptance rate 2012 3197 Private
Arizona Summit Law School 72.944759 Acceptance rate 2013 3197 Private
Arizona Summit Law School 84.96945 Acceptance rate 2014 3197 Private
Arizona Summit Law School 84.96945 Acceptance rate 2015 3197 Private
Arizona Summit Law School 68.858655 Acceptance rate 2016 3197 Private
Arizona Summit Law School 73.397717 Acceptance rate 2017 3197 Private
Arizona Summit Law School 64.090909 Acceptance rate 2018 3197 Private
Arizona Summit Law School Acceptance rate 2019 3197 Private
Arizona Summit Law School Acceptance rate 2020 3197 Private
Arizona Summit Law School Bar Passage rank 1994 3197 Private
Arizona Summit Law School Bar Passage rank 1995 3197 Private
Arizona Summit Law School Bar Passage rank 1996 3197 Private
Arizona Summit Law School Bar Passage rank 1997 3197 Private
Arizona Summit Law School Bar Passage rank 1998 3197 Private
Arizona Summit Law School Bar Passage rank 1999 3197 Private
Arizona Summit Law School Bar Passage rank 2000 3197 Private


Friedman's test code not working

$
0
0
Hi,

I ran the code for a Friedman's test comparing multiple variables: https://www.stata.com/statalist/arch.../msg00691.html

However I cannot get it to work (while I did save my file before running the code). How can I get this code to work?I have a panel data set and I want to compare 11 interaction variables that I have (dummy x independent variable). Or if this is not possible, I would like to use the group variable which is used for creating the 11 dummies and then check differences between these groups. When I try to run the code on the interaction variables, it says: / invalid name.

How could I get this code to work? It seems to be exactly what I want, as I want to compare all groups individually (group 1 with group 2, group 1 with 3 etc.) but I cannot get it to work.

Thanks in advance.


Average Marginal Effects and logit statistics

$
0
0
Dear everyone,

I am working for the first time with average marginal effects (AME) and have some questions regarding this:

1) In order to obtain the AME I used the "logit" command with all my variables and then used the " margins, dydx(*)" command. My question is now whether I can also interpret the LR chi2(21) , the Prob > chi2 and the Pseudo R2 statistics of the former calculated logit model, or do they exclusively belong to the logit model? In my understanding this should not be possible, but my superviser still said that I should interpret these statistics.
2) I also used the "estat ic" command to get the AIC and BIC statistics. Now again, are these statistics only refering to the logit model or also to the AME model?

If this is also interesting for you guys to know: I am doing a binary logistic regression with predictor and control variables of metric, ordinal and nominal scale.

Thank you very much!

Cross product

$
0
0
Hi,

I'm new to Mata and I'm still getting my feet wet, so apologies if this is a dumb question.

I'm a little confused about some of the terminology, particularly with respect to the -cross- function.

The manual states that this computes matrix multiplication of the form X'X.

My question is this: Is this a common use of the term cross product? I've only learned cross product as the product of two vectors that produces a third, orthogonal vector (as in https://en.wikipedia.org/wiki/Cross_product). Is this just a terminology issue or is there something that I'm missing about how those two relate to one another? I've noticed similar uses of the term cross product in Cameron & Trivedi's Microeconometrics text.

Thanks in advance.

Uniforming string variable with loop

$
0
0
Hi everyone! I have encountered the following problem while doing some data cleaning.
I have a list of 30k + observations something like:
application_ id firm_name
23 APPLE
24 APPLE
24 GOOGLE
26 APPLE INC.
27 APPLE & CO.
32 APPLE INC. (USA)
72 GOOGLE CORP.
75 GOOGLE CORP.











I would like to write a code conforming the different firm names, ideally to the shortest one (e.g. "APPLE").

My code is:

levelsof firm_name, local(names)

foreach n in `names' {
gen presence = strpos(firm_name, `n') > 0
replace firm_name = `n' if presence==1
drop presence
}

But I am getting "invalid name" type of error.

Many thanks for the help!

Transformation of variables

$
0
0
Dear Stata list community,
I am having trouble deciding whether to log my variables or not. If proportion of land dedicated to a crop is the dependent variable, and yield, standard deviation of yield (measuring risk), price of the crop and standard deviation of the price of the crop (measuring risk) are the independent variables.
- Would it make more sense to log these independent variables as they are unlikely to have a linear relationship with the dependent variable?
- Furthermore, how would log of standard deviation of yield (kg/m^2) be interpreted?

Thank you for your time.

Error using &quot;mixlogit&quot; on StataSE 15: &quot;__00000P not found&quot;

$
0
0
Hello,
I am attempting to analyze data from a discrete choice experiment using the "mixlogit" package and I am getting the following error, " __00000P not found". I was able to estimate a conditional logit model using the same data/code and have estimated a mixed logit model in the past using very similar code. I have searched the forums and can not find an example of this.

The data is made up of about 1100 respondents who were each presented with 8 choice sets. Each choice set contained 2 options, with varying prices and one other variable (anti) as well as an opt out option (asc). anti2 and anti3 are coded as dummy variables.

Code:
mixlogit y asc price if MRK_CELL1==1 & MRK_Level_LFQ1==1, rand (anti 2 anti3) group(gid) id(pid) nrep(500)

I used set trace to identify where the error was coming from.

----------------------------------------------------- begin ml_count_eval ---
- version 10
- args f type
- if `:length global ML_dots' {
= if 1 {
- $ML_dots "`f'" "`type'" = * "__00000N" "input"
- }
------------------------------------------------------- end ml_count_eval ---
- scalar `h' = 1/(2*`h')
= scalar __00000O = 1/(2*__00000O)
- mat `dd2' = `dd2' - `dd1'
= mat __00000P = __00000P - __00000M
__00000P not found
mat `dd2' = `h' * `dd2'
mat `v' = nullmat(`v') \ `dd2'
local i = `i' + 1
}
----------------------------------------------------------------- end ml_e1 ---
------------------------------------------------------------------ end ml_opt --- }


Any help on this issue would be greatly appreciated.

Best regards,
Mitchell King
University of Guelph
Viewing all 65489 articles
Browse latest View live


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