I am using a linear regression model to determine the effect of diet score at baseline as predictor of weight at follow up where:  lm(weight_followup ~ Diet_Score*weight_base)  When I center my predictor variables I get the following:     However, the main effect changes when I do the same un centered:   From clinical knowledge, the second set of results (uncentered) makes more sense, as Diet Score (aka quality) weight at follow up goes down.   Not sure what to use, as some posts suggest that if using continous predictors where 0 is not in the data range than predictors should centered.  All suggestions welcome. Its a large dataframe of N = 3000.
I have a question related to multiple regression and interaction, inspired by this CV thread:    When checking for a moderation effect I do center my independent variables and multiply the centered variables in order to calculate my interaction term. Then I run my regression analysis and check for main and interaction effects, which may show the moderation.  If I redo the analysis without centering, apparently the coefficient of determination ($R^2$) does not change but the regression coefficients ($\beta$s) do. That seems clear and logical.  What I do not understand: The p-values of the main effects change substantially with centering, although the interaction does not (which is right). So my interpretation of main effects could change dramatically - just determined by centering or not. (It's is still the same data, in both analyses!)  Can somebody clarify? - Because that would mean that the option to center my variables would be mandatory and everybody should do it in order to get the same results with the same data.    Thanks a lot for distributing to that problem and your comprehensive explanations. Be assured that your help is very much appreciated!  For me, the biggest advantage of centering is to avoid multicollinearity. It is still quite confusing to establish a rule, whether to center or not. My impression is, that most of the resources suggest to center, although there are some "risks" when doing it. Again I want to put out the fact, that 2 researchers dealing with the same material and data might conclude different results, because one does centering and the other does not. I just read some part of a book by Bortz (he was a Professor and kind of a Statistics Star in Germany and Europe), and he does not even mention that technique; just points out to be careful in interpreting main effects of variables when they are involved in interactions.  After all, when you conduct a regression with one IV, one moderator (or second IV) and a DV, would you recommend to center or not?
(This question is meant to be a resource to direct others to given that this is a common question.)  Given the task of creating an image that will be printed at a certain size, what pixel dimensions and resolution should I be setting my file at? What is an intuitive way of understanding Ostrogradsky instability? Is there a way of explaining why no differential equations in physics exceed order two without delving into Lagrangian and Hamiltonian mechanics - i.e. from Newtonian mechanics? Moreover, is there such an alternative proof, which focuses more on physical reasoning than abstract mathematics? Install a .NET windows service without InstallUtil.exe Setting custom UITableViewCells height Why exactly did the Sorting Hat originally want to put Harry in Slytherin? Note: I will expand this question with more specific points when I have my own internet connection and more time (we're moving in, so I'm at a friend's house).  This question is broad, involved, and to some degree subjective.  (I started out as a physics-only student, but eventually decided to add a mathematics major. I am greatly interested in mathematics; the typical curriculum required for physics students is not deep or thorough enough; mathematics is more general (that means work!); and it only requires a few more classes. Naturally, I enjoy  immensely.)  This question asks mainly of undergraduate-level study, but feel free to discuss graduate-level study if you like.  Please do not rush your answer or try to be comprehensive. I realize the StackOverflow model rewards quick answers, but I would rather wait for a thoughtful, thorough (on a point) answer than get a fast, cluttered one. (As you probably know,  produces clear, useful writing; and a properly-done comprehensive answer would take more than a reasonable amount of time and effort.) If you think an overview is necessary, that is fine.  For a question this large, I think the best thing to do is focus on a specific area in each answer.    Update: To Sklivvz, Cedric, Noldorin and everyone else: I had to run off before I could finish, but I wanted to say I knew I would regret this; I was cranky and not thinking clearly, mainly from not eating enough during the day. I am sorry for my sharp responses and for not waiting for my reaction to pass. I apologize.  Re: Curricula:   Please note that I am not asking about choosing your own curriculum in college or university. I did not explicitly say that, but several people believed that was my meaning. I will ask more specific questions later, but the main idea is how a physics student should study mathematics (on his or her own, but also by choosing courses if available) to be a competent mathematician with a view to studying physics.  I merely mentioned adding a mathematics major to illustrate my conclusion that physics student need a deeper mathematical grounding than they typically receive.   And now I have to run off again. How would you represent "religion" in an icon, neutrally? I am trying to get a better feel for the topology of ordinals and just received a great answer to this  where the Cantor-Bendixson rank and degree turn out to be a complete homeomorphism invariant of countable compact spaces. Now I am curious about what is going on within homeomorphism classes of ordinals. In particular, I want to know how to characterize countable ordinals $\alpha$ which are minimal among all ordinals homeomorphic to $\alpha$.   Certainly finite ordinals and $\omega$ are easy. Next, if $\alpha\cong \omega+1$, then it seems like we would have to have $\omega+1\leq \alpha&lt;\omega +\omega$ since there can only be one limit point in $\alpha$. Things become a little fuzzier for me with ordinals that have infinitely many limit points.  For instance, suppose $\alpha$ is an ordinal homeomorphic to $\omega^{\omega}$. Is it necessarily true that $\alpha\geq \omega^{\omega}$? Is there a general rule for knowing when an ordinal is the smallest among all ordinals homeomorphic to it? Does C1 code coverage analysis exist for Ruby? I'm currently using  to get C0 code coverage analysis for a rails project that I'm working on.  However, those results are practically meaningless- I have 100% coverage according to rcov (as it only covers C0 analysis) and I've barely written half the test cases for the functionality that exists thus far.  I'm used to the useful results from the code coverage in Visual Studio 2008 Team, which has C1 coverage.  Are there any tools that provide similar coverage for ruby? Page number position Turning live() into on() in jQuery writing js objects to files (including methods) in nodejs? How do I calculate rotation caused by bounce friction? Is there a specific term for a statement that uses words such that their precise meaning conveys a subtext contrary to the colloquial meaning?  For example, the joke in Men in Black:     Gentlemen, congratulations. You're everything we've come to expect   from years of government training.   where the precise use of the words conveys a sarcastic meaning (ie that the candidates are inept because that's what he's come to expect from government training).  I was going to use "irony" to describe this but then realized this is basically the opposite of irony - the use of words to convey their literal intention, when a nonliteral intention was expected. Why is gravity stronger than other forces at the macroscopic level, yet weaker than other forces at the quantum level? Is there an explanation? How do I call functions loaded from a Static Resource JavaScript file? I'd like to put some shared Javascript to Resource file to reuse it between several components. This Javascript is general purpose set of utility functions. However, functions from my resource file are not available from the Components. Static resource (named TestScript):  function helloWorld() {      return 42; }   Component:  &lt;ltng:require scripts="{!$Resource.TestScript}" &lt;ui:button label="Do job" press="{!c.doJob}"/&gt;   Controller:  doJob: function(cmp, event, helper) {      var i = helloWorld();      // failed with Uncaught ReferenceError: helloWorld is not defined }   I don't like to use  &lt;ltng:require scripts="{!$Resource.***resourceName***}" afterScriptsLoaded="{!c.afterScriptsLoaded}" /&gt;   because my static resource is a set of functions and I'd like just use them as functions later in my controllers. How can I achieve that (if possible)? If not, what's the suggested solution? What is the Euler Totient of Zero? Wolfram MathWorld defines the Euler Totient function as follows:  The totient function phi(n), also called Euler's totient function, is defined     as the number of positive integers &lt;=n that are relatively prime to (i.e., do  not contain any factor in common with) n, where 1 is counted as being  relatively prime to all numbers   By this definition would $\phi(0)=0$? `http_proxy` not showing up with `printenv` on WSL I am having trouble getting pip to work behind a corporate firewall. I added the http and https proxies to my /etc/environment file, and if I execute echo "$HTTP_PROXY" it prints the right thing. However, if I execute env or printenv none of the proxy variables show up. I think this is why pip is failing too. Any insight would be appreciated. My /etc/environment file looks like  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" http_proxy="http://&lt;stuff&gt;.&lt;stuff&gt;.org:80" HTTP_PROXY="http://&lt;stuff&gt;.&lt;stuff&gt;.org:80" https_proxy="https://&lt;stuff&gt;.&lt;stuff&gt;.org:443" HTTPS_PROXY="https://&lt;stuff&gt;.&lt;stuff&gt;.org:443"   And I added the same lines to my ~/.bashrc file as well. Inform moderators migrating a question if the migration would have been normally blocked Why is the $(\frac{1}{2},\frac{1}{2})$ representation of the Lorentz group realized as the vector space of Hermitian $2\times 2$ matrices?