hw8 and task 2

profilepbiner
ManualregressioncalculationofMotulskyexamplech.22-23updated.xlsx

Background

Motulsky example for correlation and linare regression (chapters 22 and 23)
lipids and insulin sensitivity
Experiment:
select random, healthy, male subjects.
infuse insulin at a standard rate.
infuse glucose to maintain blood glucose level constant
This determines insulin sensitivity as follows:
insulin triggers cells to take up glucose.
the higher someone's insulin sensitivity, the more glucose is taken up at the same insulin level.
Thus, the speed of glucose uptake (in mg/m2/min) is an indirect measure for insulin sensitivity.
Total glucose uptake (as measured from declining levels in the blood) is also dependent on the size and weight of an individual.
Therefore, the speed of glucose uptake is standardized. This is done not by weight but by body surface (in m2).
Determine the fatty acid composition of muscle cells (cell membranes) from biopsies.
Specifically, analyze the proportion of C20-C22 polyunsaturated fatty acids within all fatty acids.

Raw data

%C20-22 fatty acids Insulin sensitivity
polyunsaturated [mg/m2/min]
17.9 250
18.3 220
18.3 145
18.4 115
18.4 230
20.2 200
20.3 330
21.8 400
21.9 370
22.1 260
23.1 270
24.2 530
24.4 375

Correlation between insulin sensitivity and fatty acid content

17.899999999999999 18.3 18.3 18.399999999999999 18.399999999999999 20.2 20.3 21.8 21.9 22.1 23.1 24.2 24.4 250 220 145 115 230 200 330 400 370 260 270 530 375

%C20-22 Fatty Acids

Insulin sensitivity

[mg/m2/min]

lines of best fit

Correlation between insulin sensitivity and fatty acid content

17.899999999999999 18.3 18.3 18.399999999999999 18.399999999999999 20.2 20.3 21.8 21.9 22.1 23.1 24.2 24.4 250 220 145 115 230 200 330 400 370 260 270 530 375

%C20-22 Fatty Acids

Insulin sensitivity

[mg/m2/min]

calculation of R, m, and b

%C20-22 Insulin sens.
fatty acids [mg/m2/min] distance to mean Product of distances (distance of x)2
X Y (for slope calculation)
17.9 250 -2.815 -34.231 96.373 7.926
18.3 220 -2.415 -64.231 155.142 5.834
18.3 145 -2.415 -139.231 336.296 5.834
18.4 115 -2.315 -169.231 391.834 5.361
18.4 230 -2.315 -54.231 125.565 5.361
20.2 200 -0.515 -84.231 43.411 0.266
20.3 330 -0.415 45.769 -19.012 0.173
21.8 400 1.085 115.769 125.565 1.176
21.9 370 1.185 85.769 101.604 1.403
22.1 260 1.385 -24.231 -33.550 1.917
23.1 270 2.385 -14.231 -33.935 5.686
24.2 530 3.485 245.769 856.411 12.143
24.4 375 3.685 90.769 334.450 13.576
Average 20.715 284.231 2480.154 66.657
Std.Dev.S 2.357 113.887
Std.Dev.P 2.264 109.419
r r2
0.834 0.6958
Motulsky r2 0.5929
0.7700025428 0.5929 OK. So they use the sample standard deviation and not the population standard deviation!
Calculation of slope (I call it m the formla calls it b) and intercept (I call it b, the formula calls it a)
2480.1538461538
66.6569230769 b= 37.2077457475 slope
a= -486.5419945992 intercept
284.2307692308 20.7153846154
y avg. x avg.

calculating SS and MS

mean of y 284.2307692308 (from cell C26)
y' value of regression line: y'=bx+a with b= 37.2077457475 slope from calcs. in previous tab
a= -486.5419945992 intercept from calcs. in previous tab
%C20-22 Insulin sens.
fatty acids [mg/m2/min]
X Y Y total Ytotal2 Y regression Yregr.2 y Residual Yresid.2
17.9 250 -34.2307692308 1171.7455621302 -104.7541149505 10973.4245990685 70.5233457198 4973.5422915087
18.3 220 -64.2307692308 4125.5917159763 -89.8710166515 8076.7996339825 25.6402474208 657.4222877987
18.3 145 -139.2307692308 19385.2071005917 -89.8710166515 8076.7996339825 -49.3597525792 2436.3851746821
18.4 115 -169.2307692308 28639.0532544379 -86.1502420768 7421.8642098913 -83.080527154 6902.3739921813
18.4 230 -54.2307692308 2940.976331361 -86.1502420768 7421.8642098913 31.919472846 1018.8527467685
20.2 200 -84.2307692308 7094.8224852071 -19.1762997314 367.7304713878 -65.0544694994 4232.0840018468
20.3 330 45.7692307692 2094.8224852071 -15.4555251566 238.8732578674 61.2247559259 3748.4707381819
21.8 400 115.7692307692 13402.5147928994 40.3560934645 1628.6142797193 75.4131373047 5687.141278135
21.9 370 85.7692307692 7356.3609467456 44.0768680393 1942.7702961533 41.6923627299 1738.2531100047
22.1 260 -24.2307692308 587.1301775148 51.5184171888 2654.1473096376 -75.7491864196 5737.9392432243
23.1 270 -14.2307692308 202.5147928994 88.7261629362 7872.3319893882 -102.956932167 10600.1298812421
24.2 530 245.7692307692 60402.5147928994 129.6546832584 16810.3368908466 116.1145475108 13482.5881436355
24.4 375 90.7692307692 8239.0532544379 137.0962324079 18795.3769404496 -46.3270016387 2146.1910808322
SUM OF SQUARES 155642.307692308 92280.933722266 63361.3739700418 Results from Minitab Fitted Line Plot analysis
Average 20.715 284.231 df SS MS
Std.Dev.S 2.357 113.887 Regression 1 92280.9337222659 92280.9337222659
Residual 11 63361.3739700418 5760.1249063674
Total 12 155642.307692308
The "standard deviation"
of the Sum of Squares (residuals)
is called the Root Mean Square (RMS) error and
is calculated like SD, but with N-2 in the denominator
Sum of squares of residuals: 63361.3739700418 (from above)
Divide by N-2 with N=13 5760.1249063674 (see value for MS(residual) in minitab output above)
take the square root of that 75.8954867325 Standard error of residuals
this is the error displayed in minitab and Excel outputs!
compare to standard error shown in Motulsky textbook, table 23.1 p. 153
(standard error is called Sy,x or standard deviation of the residuals

p value for Regression

CALCULATION OF P VALUE FOR RESIDUALS USING VARIANCE ANALYSIS AND F DISTRIBUTION

confidence interval for R

CONFIDENCE INTERVAL FOR PEARSON CORRELATION COEFFICIENT R
(not given by minitab or Excel)
INPUT
r= 0.7700025428
N= 13
α = 0.05
Step 1: Transform r value to z value, using Fisher r to z transformation
Formula: EXCEL function FISHER(x)
(replace x with your r value)
OUTPUT
Fisher (B4)
Transform r from above into z: Calculation: z= 1.0203340046
Step 2: Calculate the confidence interval for the transformed z value
The z distribution for r values is a normal distribution,
but with a standard deviation of
instead of 1.
For confidence level of 95%: OUTPUT
Lower confidence limit for z: Formula zlow = z - 1.96 * SD = z - 1.96 / sqrt (N-3)
Calculation zlow = 0.4005275832
Upper confidence limit for z: Formula zhigh = z + 1.96 * SD = z + 1.96 / sqrt (N-3)
Calculation zhigh = 1.640140426
Step 3: do a backward transformation from z to r to calculate the confidence interval for r
Formula for inverse Fisher r to z transformation (i.e. Fisher z to r transformation)
EXCEL function: FISHERINV(y)
OUTPUT
For confidence level of 95%: FISHERINV(G25)
Lower confidence limit for r: rlow = 0.3804002924
FISHERINV(G28)
Upper confidence limit for r: rhigh = 0.9274921955