Page 1 of 1

Issue with factor variables

Posted: Tue Mar 20, 2012 2:18 pm
by leap
Dear all,

I included some factor variables in my regression and I keep on receiving an error message.

The regression code is the following (simplified version of my actual regression):

Code: Select all

runmlwin x011 cons c.gtrust_rdev##c.educ_nat , ///
	level3(s003: cons) level2(x048: cons) level1(id:) ///
	discrete(distribution(poisson) pql2) nopause
The error message is the following:

__000003 is held to more precision than MLwiN can handle, to reduce the precision use recast float __000003, force
r(198);

I have tried to recast the variable:

Code: Select all

recast float __000003, force
but I obviously get the following error message

variable __000003 not found


When I construct the interaction and run the regression, I don't encounter any problems.

Code: Select all

gen gtrustdev_educ = gtrust_rdev*educ_nat

runmlwin x011 cons gtrust_rdev educ_nat gtrustdev_educ, ///
	level3(s003: cons) level2(x048: cons) level1(id:) ///
	discrete(distribution(poisson) pql2) nopause
I would like to use the margins commands after my regression, which is why I would like to use factor variables.

Thank you for your help.

Re: Issue with factor variables

Posted: Tue Mar 20, 2012 6:51 pm
by ChrisCharlton
Thanks for letting us know about this. You cannot recast __000003 because it is a temporary variable that is only created for the duration that runmlwin is running. We have now added code to ensure that these generated variables are kept to the correct precision for MLwiN in our development version, so this should be fixed in the next release.

Re: Issue with factor variables

Posted: Wed Mar 21, 2012 8:58 am
by leap
Thank you for the prompt answer.
I will be looking forward to the new release!