I am having a lot of difficulty figuring out why I cannot calculate a 95% CI by hand with one set of data; but I can using the same process with a different set of data.  Drawing on OLS results; I am doing the following calculation:  beta ± 1.96 * standard error   Here are two sets of data in Python if you wanted to execute it yourself.  rng = np.random.RandomState(42) x = 10 * rng.rand(50) x2 = 10 * rng.rand(50) y = 2 * x - 1 + rng.randn(50)  X_1 = np.column_stack((np.repeat(1, len(x)), x, x2)) y_1 = np.vstack(y)  model = sm.OLS(y_1, X_1) res = model.fit() print(res.summary())  model result for x1: coef: 1.86, std err: 0.043, lower ci: 1.78, upper ci: 1.954   Calculate 95% CI by hand to replicate the result above:  lower: 1.86 - 1.96*0.043 = 1.77 ; correct upper: 1.86 + 1.96*0.043 = 1.94 ; correct   Now, do the same thing with different data.  y = np.array([10, 7, 2, 8, 10, 6, 2, 10, 8, 5]) x1 = np.array([2, 1, 2, 0, 1, 3, 11, 0, 5, 0]) x2 = np.array([5, 1, 0, 2, 0, 0, 0, 0, 12, 2])  y = np.vstack(y) X = np.column_stack((np.repeat(1, len(x1)), x1, x2))  model = sm.OLS(y, X) res = model.fit() print(res.summary())  model result for x1: coef: -0.52, std err: 0.265, lower ci: -1.15, upper ci: 0.10   Calculate 95% CI by hand to replicate the result above:  lower: -0.52 - 1.96*0.265 # -1.03 - not correct upper: -0.52 + 1.96*0.265 # 0 - not correct
I want to be able to calculate the confidence interval from the estimated coefficient and respective standard errors.  I have a linear regression model which can be summarized (in R):  summary(fit1)  Call: lm(formula = bwt ~ height + weight + parity, data = data)  Residuals:     Min      1Q  Median      3Q     Max  -66.913 -10.624   0.991  10.979  55.621   Coefficients:             Estimate Std. Error t value Pr(&gt;|t|)     (Intercept) 31.19217   13.56879   2.299   0.0217 *   height       1.24964    0.23083   5.414 7.48e-08 *** weight       0.06781    0.02823   2.402   0.0164 *   parity1     -1.83309    1.19838  -1.530   0.1264     --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  Residual standard error: 17.9 on 1170 degrees of freedom Multiple R-squared:  0.04898,   Adjusted R-squared:  0.04654  F-statistic: 20.08 on 3 and 1170 DF,  p-value: 1.071e-12   With this model I can calculate the respective confidence intervals:  &gt; confint(fit1)                   2.5 %     97.5 % (Intercept)  4.57029503 57.8140351 height       0.79676227  1.7025207 weight       0.01243198  0.1231932 parity1     -4.18429933  0.5181151   I would expect the intervals of the predictor height to be given by  $$ 1.24964 \pm (1.96*0.23083) = [0.7972132,1.702067] $$  where 1.24964 is the estimated value for the coefficient and 0.23083 is the standard error for this coefficient. The numbers are close but not quite the same.  What am I doing wrong?
How to retrieve multiple rows from database in PHP How can I use Photoshop to imitate a photo taken with a low-quality camera? How can I create an image in Photoshop that imitates a photo taken with a low-quality phone camera? Examples of qualities I want to simulate:   blurring in some areas caused by a dirty lens low quality exposure handling in the darkroom noise   Some examples: See how many duplicates of a post? Can I see how many duplicates there are of a post? I.e. how many posts have been labelled as duplicate because of this post? If so, how? And can I also get a list of these duplicated posts? Set value of textarea in jQuery I am attempting to set a value in a textarea field using jquery with the following code:  $("textarea#ExampleMessage").attr("value", result.exampleMessage);   The issue is, once this code executes, it is not altering the text in the textarea?  However when performing an alert($("textarea#ExampleMessage").attr("value")) the newly set value is returned? Why didn't Palpatine publicly change his name once he became Emperor? Anakin Skywalker was known as Darth Vader (this was already his Sith name) after the creation of the Galactic Empire.  So why did Palpatine remain "Emperor Palpatine"? Why didn't he embrace his persona as Darth Sidious?  I started wondering after reading one of the answers to Show forms in a modal window I have a form and I am using Drupal 7. I need to show this form in a popup when a user clicks a link. The user should then be able to complete the form whilst in the pop up window. I can use anything like  or modals or anything. I just wanted to know which is the better option and what options do I have for Drupal. Redirect www to non-www using Apache htaccess does not work 'const int' vs. 'int const' as function parameters in C++ and C Consider:  int testfunc1 (const int a) {   return a; }  int testfunc2 (int const a) {   return a; }   Are these two functions the same in every aspect or is there a difference?  I'm interested in an answer for the C language, but if there is something interesting in the C++ language, I'd like to know as well. efficient and accurate approximation of error function I am looking for the numerical approximation of error function, which must be efficient and accurate. Thanks in advance $$\mathrm{erf}(z)=\frac2{\sqrt\pi}\int_0^z  e^{-t^2} \,\mathrm dt$$ How to export a individual layer with a fixed master layer in Photoshop? Let's say I have some layers and a single different one, or a group of layers I want to export merged together, in a way that every single exported layer is merged with a specific layer or group of layers.  In the example below I have some layers which need to be exported into JPG or PNG, merged with the very top layer called "Blurred". In my case, I want to export the layers (Jan 8 + Blurred) and (Layer 10 + Blurred) and so on. Acting as exporting layers merged with a master layer called "Blurred".  My question in a simple way: how to apply a Master layer(s)/Group(s) in Photoshop to be exported with every layer I have? Looking for a (short?) story about a cryo ship looking for habitable planets I read this story/novella at least 15 years ago, probably 20 or more. It is about a ship, travelling through the universe, looking for habitable planets. Why, I can't remember. People are held in Cryo Stasis and I think they are wearing nothing in the chamber but some kind of mesh. Every time the ship gets close to a planet it wakes one or two of the people (one woman, one man?) to check it out but they never find anything good. I think in the end they wake up and discover, that they have arrived back at Earth. Other details are very vague but I seem to recall there was lots of stuff about a (blue?) light, dreaming/dreams and something about the cold, or cold blue lights or similar. Does that ring a bell for anyone? Lifting idempotents modulo a nilpotent ideal The problem is this:      Suppose $I \subseteq R$ is a nilpotent ideal and there is $r \in R$ with $r \equiv r^2 \pmod I$. Show $r \equiv e \pmod I$ for some $e \in R$ idempotent.   I have spent a few hours rolling around in abstracta with no destination. I believe that if I could write down a concrete example of this, the example could guide me through the abstract definitions and show me where to look for an idempotent in $R$. I have looked at 2x2 matrices and could not find any such examples. Might anybody have one? In PostgreSQL is the row ordering preserved in functions and CTEs? Custom Gmail labels sort I want to sort the labels in my own order instead of the default abc order, so that, for example, the label named bills should come up first.  Any way to do that? Network simplex method, leaving and entering variables Could someone give me a hint on this question, which is a past exam question:     Under what circumstances will an entering variable in the network simplex method be the same as the leaving variable?   Thank you for your help. Is there a tool to get the lines in one file that are not in another? How to initialize a JavaScript Date to a particular time zone Test of whole distribution for two samples "Whether" Vs. "If" I would like to find the correlation between a continuous (dependent variable) and a categorical (nominal: gender, independent variable) variable. Continuous data is not normally distributed. Before, I had computed it using the Spearman's $\rho$. However, I have been told that it is not right.  While searching on the internet, I found that the boxplot can provide an idea about how much they are associated; however, I was looking for a quantified value such as Pearson's product moment coefficient or Spearman's $\rho$. Can you please help me on how to do this? Or, inform on which method would be appropriate?  Would Point Biserial Coefficient be the right option?