In[]:=
$Version
Out[]=
12.1.0 for Mac OS X x86 (64-bit) (March 14, 2020)
Here is some data that is going to cause trouble; it comes from a CopulaDistribution if it matters
In[]:=
unpleasant={{-0.18765344042046503`,1,1},{-0.7868417124501981`,0,0},{0.5159877297060876`,1,0},{0.5192552864411443`,1,1},{-0.344034593110404`,1,1},{0.4271541695794353`,1,1},{-0.8105323274640571`,0,1},{-0.2615840458685881`,1,1},{0.17145086850545183`,1,1},{-2.212384312432726`,0,0},{0.5688136764148906`,1,1},{0.32765406179511536`,1,1},{1.2853090964313258`,1,1},{-0.4141158288462166`,1,0},{-0.1998832888320074`,1,1},{0.22233926060893827`,1,1},{-1.3950479727543563`,1,0},{-0.19610182024695302`,0,0},{0.7957424118817192`,1,1},{-0.7477080037535241`,1,0},{-0.2398443950865801`,1,1},{-0.014513991786248733`,1,1},{0.7403747849770742`,1,1},{0.0009430098138824265`,0,1},{0.8067655004254857`,1,1},{1.5727656192536221`,1,1},{1.6949798505254474`,1,1},{1.1406137792154913`,1,1},{-0.5779852039553085`,1,1},{-1.2722561308326152`,0,1}};
I try to fit it
In[]:=
fail=LogitModelFit[unpleasant,{1,x,a},{x,a},NominalVariables{a}]
General
:Exp[-6.71089×
7
10
] is too small to represent as a normalized machine number; precision may be lost.
General
:Exp[-1.34218×
8
10
] is too small to represent as a normalized machine number; precision may be lost.
General
:Exp[-6.71089×
7
10
] is too small to represent as a normalized machine number; precision may be lost.
General
:Further output of General::munfl will be suppressed during this calculation.
LogitModelFit
:Non-real values were encountered during the IRLS process. The specified model may not be appropriate for the data.
Out[]=
LogitModelFit[{{-0.187653,1,1},{-0.786842,0,0},{0.515988,1,0},{0.519255,1,1},{-0.344035,1,1},{0.427154,1,1},{-0.810532,0,1},{-0.261584,1,1},{0.171451,1,1},{-2.21238,0,0},{0.568814,1,1},{0.327654,1,1},{1.28531,1,1},{-0.414116,1,0},{-0.199883,1,1},{0.222339,1,1},{-1.39505,1,0},{-0.196102,0,0},{0.795742,1,1},{-0.747708,1,0},{-0.239844,1,1},{-0.014514,1,1},{0.740375,1,1},{0.00094301,0,1},{0.806766,1,1},{1.57277,1,1},{1.69498,1,1},{1.14061,1,1},{-0.577985,1,1},{-1.27226,0,1}},{1,x,a},{x,a},NominalVariables{a}]
Now I jiggle the data
In[]:=
jiggled=(SeedRandom[10];RandomSample[unpleasant])
Out[]=
{{-0.014514,1,1},{0.327654,1,1},{-2.21238,0,0},{0.222339,1,1},{0.519255,1,1},{-0.747708,1,0},{0.427154,1,1},{-0.239844,1,1},{0.515988,1,0},{1.69498,1,1},{-1.27226,0,1},{-0.196102,0,0},{1.28531,1,1},{-0.187653,1,1},{-0.199883,1,1},{0.795742,1,1},{1.57277,1,1},{-0.786842,0,0},{1.14061,1,1},{0.806766,1,1},{-0.810532,0,1},{0.568814,1,1},{0.740375,1,1},{0.00094301,0,1},{-1.39505,1,0},{-0.344035,1,1},{-0.261584,1,1},{-0.577985,1,1},{-0.414116,1,0},{0.171451,1,1}}
In[]:=
success=LogitModelFit[jiggled,{1,x,a},{x,a},NominalVariables{a}]
Out[]=
FittedModel
1
1+
-1.61196-1+1


In[]:=
success["ParameterTable"]
Out[]=
Estimate
Standard Error
z-Statistic
P-Value
1
1.61196
0.629668
2.56001
0.0104668
x
1.78503
0.890207
2.00518
0.0449433
a[0]
-0.121082
1.23796
-0.0978074
0.922085
See how often jiggling works
In[]:=
Quiet@AssociationMap[(SeedRandom[#];Check[LogitModelFit[RandomSample[unpleasant],{1,x,a},{x,a},NominalVariables{a}],$Failed])&,Range[20]]
Out[]=
1$Failed,2FittedModel
1
1+
-1.61196-1+1

,3$Failed,4$Failed,5$Failed,6FittedModel
1
1+
-1.61196-1+1

,7$Failed,8$Failed,9$Failed,10FittedModel
1
1+
-1.61196-1+1

,11$Failed,12FittedModel
1
1+
-1.61196-1+1

,13$Failed,14$Failed,15FittedModel
1
1+
-1.61196-1+1

,16$Failed,17$Failed,18$Failed,19FittedModel
1
1+
-1.61196-1+1

,20FittedModel
1
1+
-1.61196-1+1

