# Simple Linear Regression: Domain Error with 0.0

**URL:** https://discourse.julialang.org/t/simple-linear-regression-domain-error-with-0-0/78717
**Category:** New to Julia
**Created:** [March 30, 2022, 3:38am UTC](https://discourse.julialang.org/t/simple-linear-regression-domain-error-with-0-0/78717 "2022-03-30T03:38:00Z")
**Posts on this page:** 8
**Page:** 2

<div class="post-metadata">

### Author: ![huang\_min](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/huang_min/32/34337_2.png) [@huang\_min](https://discourse.julialang.org/u/huang_min)
#### Post date: [March 31, 2022, 1:46am UTC](https://discourse.julialang.org/t/simple-linear-regression-domain-error-with-0-0/78717/21 "2022-03-31T01:46:40Z")

</div>

Could you clearly explain 1000 in normalize()? I suspect that you do not ever read the help file.

---

<div class="post-metadata">

### Author: ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)
#### Post date: [March 31, 2022, 2:05am UTC](https://discourse.julialang.org/t/simple-linear-regression-domain-error-with-0-0/78717/22 "2022-03-31T02:05:14Z")

</div>

1000 is simply a scaling parameter. Since each  
column in my df is linearly independent, it is less  
presentable when I plot the outputs. The value  
itself is arbitrary, but ultimately it is intended to  
standardize the dataset across the attributes.

---

<div class="post-metadata">

### Author: ![huang\_min](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/huang_min/32/34337_2.png) [@huang\_min](https://discourse.julialang.org/u/huang_min)
#### Post date: [March 31, 2022, 2:08am UTC](https://discourse.julialang.org/t/simple-linear-regression-domain-error-with-0-0/78717/23 "2022-03-31T02:08:29Z")

</div>

This post was temporarily hidden by the community for possibly being off-topic, unfocused, inappropriate, or spammy.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [March 31, 2022, 7:28am UTC](https://discourse.julialang.org/t/simple-linear-regression-domain-error-with-0-0/78717/24 "2022-03-31T07:28:58Z")

</div>

I think there’s no need to get personal here - I would tend to agree that it would be helpful for OP to consult some introductory statistics/econometrics textbooks to get a better understanding of the methodologies he’s using, but that’s not all that relevant to the concrete question at hand.

What I would humbly ask of you, @YummyPampers2, though is to be respectful of other people’s time and effort spent helping him. Practically this means reading [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757) and following the advice given there, and in particular making sure that a question is backed up by an example which produces the actual error you’re seeing.

In this case four people have tried helping you with a problem that could not actually be reproduced from the code you posted, and only 24 hours and 17 posts into the thread did you reveal that actually you were running an entirely different regression on different data when you got the error you were asking about. In the event you were lucky that an econometrics professor from one of the leading departments in Europe was on hand to correctly guess what your problem is despite the inadequate MWE, but it’s easy to see how in a slightly different situation the wild goose chase could have gone on for quite some time.

---

<div class="post-metadata">

### Author: ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)
#### Post date: [March 31, 2022, 9:50am UTC](https://discourse.julialang.org/t/simple-linear-regression-domain-error-with-0-0/78717/25 "2022-03-31T09:50:09Z")

</div>

This post was temporarily hidden by the community for possibly being off-topic, unfocused, inappropriate, or spammy.

---

<div class="post-metadata">

### Author: ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)
#### Post date: [March 31, 2022, 9:59am UTC](https://discourse.julialang.org/t/simple-linear-regression-domain-error-with-0-0/78717/26 "2022-03-31T09:59:52Z")

</div>

@nilshg – thanks for your note.

For this thread, as I expressed, I used  
too many attributes for the OLS in my  
original formulation. I was able to  
adapt what @mcreel had suggested  
about degrees of freedom and sample  
size, and reduce the dimensions used  
to inform the OLS model.

The issue was resolved.

---

<div class="post-metadata">

### Author: ![huang\_min](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/huang_min/32/34337_2.png) [@huang\_min](https://discourse.julialang.org/u/huang_min)
#### Post date: [March 31, 2022, 10:01am UTC](https://discourse.julialang.org/t/simple-linear-regression-domain-error-with-0-0/78717/27 "2022-03-31T10:01:09Z")

</div>

This post was temporarily hidden by the community for possibly being off-topic, unfocused, inappropriate, or spammy.

---

<div class="post-metadata">

### Author: ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)
#### Post date: [March 31, 2022, 3:12pm UTC](https://discourse.julialang.org/t/simple-linear-regression-domain-error-with-0-0/78717/28 "2022-03-31T15:12:36Z")

</div>

FWIW I think this kind of error will be fixed by [https://github.com/JuliaStats/GLM.jl/pull/458](https://github.com/JuliaStats/GLM.jl/pull/458). Then you will get a coefficients table with infinite standard errors and confidence intervals and p-values equal to 1 for the problematic coefficients. Hopefully this will make it a bit easier to understand what is going on.

[Previous page](https://discourse.julialang.org/t/simple-linear-regression-domain-error-with-0-0/78717.md?page=1)
