TAMS38 Computer exercises 4



Relevanta dokument
TAMS38 Datorövning 4

TAMS28 DATORÖVNING VT1

This exam consists of four problems. The maximum sum of points is 20. The marks 3, 4 and 5 require a minimum

Kurskod: TAMS28 MATEMATISK STATISTIK Provkod: TEN1 05 June 2017, 14:00-18:00. English Version

Kurskod: TAIU06 MATEMATISK STATISTIK Provkod: TENA 31 May 2016, 8:00-12:00. English Version

Kurskod: TAIU06 MATEMATISK STATISTIK Provkod: TENA 17 August 2015, 8:00-12:00. English Version

7.1 Hypotesprövning. Nollhypotes: H 0 : µ = 3.9, Alternativ hypotes: H 1 : µ < 3.9.

Kurskod: TAIU06 MATEMATISK STATISTIK Provkod: TENA 15 August 2016, 8:00-12:00. English Version

Statistical Quality Control Statistisk kvalitetsstyrning. 7,5 högskolepoäng. Ladok code: 41T05A, Name: Personal number:

Preschool Kindergarten

Kurskod: TAMS24 / Provkod: TEN (8:00-12:00) English Version

Module 6: Integrals and applications

Workplan Food. Spring term 2016 Year 7. Name:

7.5 Experiment with a single factor having more than two levels

8.1 General factorial experiments

Kurskod: TAMS11 Provkod: TENB 07 April 2015, 14:00-18:00. English Version

Support Manual HoistLocatel Electronic Locks

Tentamen i Matematik 2: M0030M.

Pre-Test 1: M0030M - Linear Algebra.

Kurskod: TAMS28 MATEMATISK STATISTIK Provkod: TEN1 08 June 2015, 14:00-18:00. English Version

Kurskod: TAMS11 Provkod: TENB 12 January 2015, 08:00-12:00. English Version

Styr- och kontrolldiagram ( )

Module 1: Functions, Limits, Continuity

LUNDS TEKNISKA HÖGSKOLA Institutionen för Elektro- och Informationsteknik

1. Compute the following matrix: (2 p) 2. Compute the determinant of the following matrix: (2 p)

Kurskod: TAMS11 Provkod: TENB 28 August 2014, 08:00-12:00. English Version

EVALUATION OF ADVANCED BIOSTATISTICS COURSE, part I

Kvalitetsarbete I Landstinget i Kalmar län. 24 oktober 2007 Eva Arvidsson


Isolda Purchase - EDI

FÖRBERED UNDERLAG FÖR BEDÖMNING SÅ HÄR

EXTERNAL ASSESSMENT SAMPLE TASKS SWEDISH BREAKTHROUGH LSPSWEB/0Y09

Tentamen i matematisk statistik

TAMS38 Datorövning 2

Metod och teori. Statistik för naturvetare Umeå universitet

8 < x 1 + x 2 x 3 = 1, x 1 +2x 2 + x 4 = 0, x 1 +2x 3 + x 4 = 2. x 1 2x 12 1A är inverterbar, och bestäm i så fall dess invers.

Chapter 2: Random Variables

Make a speech. How to make the perfect speech. söndag 6 oktober 13

Datorövning 5. Statistisk teori med tillämpningar. Lära sig beräkna konfidensintervall och utföra hypotestest för:

DVG C01 TENTAMEN I PROGRAMSPRÅK PROGRAMMING LANGUAGES EXAMINATION :15-13: 15

Health café. Self help groups. Learning café. Focus on support to people with chronic diseases and their families

Mälardalens Högskola. Formelsamling. Statistik, grundkurs

Normalfördelning. Modeller Vi har alla stött på modeller i olika sammanhang. Ex:

Betrakta kopparutbytet från malm från en viss gruva. För att kontrollera detta tar man ut n =16 prover och mäter kopparhalten i dessa.

Enkel linjär regression. Enkel linjär regression. Enkel linjär regression

Webbregistrering pa kurs och termin

English Version. 1 x 4x 3 dx = 0.8. = P (N(0, 1) < 3.47) = =

Lö sningsfö rslag till tentamen i matematisk statistik Statistik öch kvalitetsteknik 7,5 hp

Isometries of the plane

LUNDS UNIVERSITET STATISTISKA INSTITUTIONEN MATS HAGNELL. Skrivning i ekonometri onsdagen den 1 juni 2011

English Version. Number of sold cakes Number of days

TAMS 28 DATORÖVNING 2

Materialplanering och styrning på grundnivå. 7,5 högskolepoäng

LÖSNINGSFÖRSLAG TILL TENTAMEN I MATEMATISK STATISTIK

Tentamen i matematisk statistik

Viktig information för transmittrar med option /A1 Gold-Plated Diaphragm

Lösningar till SPSS-övning: Analytisk statistik

Grafisk teknik IMCDP IMCDP IMCDP. IMCDP(filter) Sasan Gooran (HT 2006) Assumptions:

Introduktion och laboration : Minitab

Installation av F13 Bråvalla

12.6 Heat equation, Wave equation

Problem som kan uppkomma vid registrering av ansökan

BOENDEFORMENS BETYDELSE FÖR ASYLSÖKANDES INTEGRATION Lina Sandström

Styrteknik: Binära tal, talsystem och koder D3:1

denna del en poäng. 1. (Dugga 1.1) och v = (a) Beräkna u (2u 2u v) om u = . (1p) och som är parallell

En scatterplot gjordes, och linjär regression utfördes därefter med följande hypoteser:

F ξ (x) = f(y, x)dydx = 1. We say that a random variable ξ has a distribution F (x), if. F (x) =

Webbreg öppen: 26/ /

7.5 Experiment with a single factor having more than two levels

Resultat av den utökade första planeringsövningen inför RRC september 2005

Libers språklåda i engelska Grab n go lessons

Datorövning Power curve 0,0305 0, Kvantiler, kritiska regioner

Lö sningsfö rslag till tentamen i matematisk statistik Statistik öch kvalitetsteknik 7,5 hp

Immigration Studying. Studying - University. Stating that you want to enroll. Stating that you want to apply for a course.

Grafisk teknik IMCDP. Sasan Gooran (HT 2006) Assumptions:

Affärsmodellernas förändring inom handeln

Grundläggande Statistik och Försöksplanering Provmoment: TEN1 & TEN2 Ladokkod: TT2311 Tentamen ges för: Bt2, En2, Bt4, En4.

I vår laboration kom vi fram till att kroppstemperaturen påverkar hjärtfrekvensen enligt

Adding active and blended learning to an introductory mechanics course

samhälle Susanna Öhman

CHANGE WITH THE BRAIN IN MIND. Frukostseminarium 11 oktober 2018

x 2 2(x + 2), f(x) = by utilizing the guidance given by asymptotes and stationary points. γ : 8xy x 2 y 3 = 12 x + 3

Aborter i Sverige 2008 januari juni

EXPERT SURVEY OF THE NEWS MEDIA

6 th Grade English October 6-10, 2014

Grafisk teknik. Sasan Gooran (HT 2006)

Beijer Electronics AB 2000, MA00336A,

Laboration med MINITAB, Del 2 Om Fyris ns global uppv rmning

2(x + 1) x f(x) = 3. Find the area of the surface generated by rotating the curve. y = x 3, 0 x 1,

SWESIAQ Swedish Chapter of International Society of Indoor Air Quality and Climate

Exempel på uppgifter från 2010, 2011 och 2012 års ämnesprov i matematik för årskurs 3. Engelsk version

- den bredaste guiden om Mallorca på svenska! -

Lösenordsportalen Hosted by UNIT4 For instructions in English, see further down in this document

Stiftelsen Allmänna Barnhuset KARLSTADS UNIVERSITET

Chapter 1 : Who do you think you are?

Laboration 2: Normalfo rdelning, regressionsanalys och korstabeller

Information technology Open Document Format for Office Applications (OpenDocument) v1.0 (ISO/IEC 26300:2006, IDT) SWEDISH STANDARDS INSTITUTE

Skrivning i ekonometri lördagen den 29 mars 2008

Tentamen i matematisk statistik

a) Bedöm om villkoren för enkel linjär regression tycks vara uppfyllda! b) Pröva om regressionkoefficienten kan anses vara 1!

Transkript:

TAMS38 Computer exercises 4 Preparation: Read about different models and analysis, especially about the choice of the sample size, regression, response surface and logistic regression. Do assignments 5b), 6a,f) before the computer exercise class. Bring collection of formulas and tables, and calculators to the computer exercise class. 1 Analysis using response surface The following data set provides data for the final attempt in a experiment via the steepest ascentmethod to find the optimal values of ph and temperature for a chemical reaction. Purity data from uniform-precision rotable Central Composite Design x 1 x 2 Temp. ph Purity Y Factorial -1-1 53 5.0 90.1 portion +1-1 55 5.0 91.8-1 +1 53 5.8 90.7 +1 +1 55 5.8 93.6 Centre 0 0 54 5.4 94.1 portion 0 0 54 5.4 94.6 0 0 54 5.4 94.2 0 0 54 5.4 93.9 0 0 54 5.4 94.0 Axial -1.414 0 52.59 5.4 89.0 portion +1.414 0 55.41 5.4 92.3 0-1.414 54 4.83 90.7 0 +1.414 54 5.96 92.5 Do we have curvature using analysis according to 2 2 -design with five observations in the central point? 1

Go to STAT/DOE/Factorial/Create Factorial Design... Choose amount of factors as 2. Click on Designs and choose Number of Center Points: 5. Put in the nine y-values in c7 in the correct order by looking on the levels of factors A and B. Name column c7 as Y. Wait with the four extra points. Go to STAT/DOE/Factorial/Analyze Factorial Design... In Response set c7. a) Perform tests of curvature at the level 0.01. Conclusion? Rename c5 and c6 as x1 and x2. Fill with extra points in the c5-c7. Then, create new columns by typing in the session window let c8=c5*c6 let c9=c5**2 let c10=c6**2 b) Rename new column as x1*x2, x1**2 and x2**2. You can now fit a quadric surface to your data. Go to Stat/Regression/Regression and fill Response: c7, Predictors: c5 c6 c8-c10. c) Is it possible, using this quadric surface, to find an optimum point? Calculate the values of x1 and x2 for the optimum point and recalculate them to the actual temperature and the actual ph. d) It might be nice to watch how the fitted quadratic surface looks. Go to Calc/Make Mesh Data... Put x1-values in c11 from -1.5 to 1.5 with 21 points and x2-values similarly in c12 (not for Z). As Z-function you should put the estimated regression expression. Write in the session window let c13=...+...*c11+...*c12+...*c11*c12... Fill in the correct coefficients from the regression analysis and remember to put all the terms. Go to Graph/3D Surface Plots/Wireframe plot and fill in Z: c13 Y: c12 X: c11. What you have obtained? 2

2 Determination of sample size under normal distribution A team of researchers want to study whether regular exercise can increase in bone mineral content in young women. One thinks to select n young women, measure their bone mineral content, allowing them to practice according to a certain program for six months and then re-measuring the mineral content in the bones. Let x i and y i stands for their mineral content (unit:%) before and after the training. Then z i = y i x i stands for the change. Previous measurements have shown that it is reasonable to assume that Z i N(µ, 4). We want to test H 0 : µ = 0 against H 1 : µ 0 on level 0.05, such that the power of the test is at least 0.90 if µ = 2. How should we choose n? a) Go to Stat/Power and Sample Size/1-sample Z. Fill in Differences: 2 Power values: 0.90 Standard deviation: 4.0 Click on Options and choose Alternative Hypothesis: Not equal samt Significance level: 0.05. Click on Graphs: and choose Display Power Curve. Then OK. Give n 1 =....... b) Repeat procedure as for the one sided test. Give n 2 =....... c) Determine power of the two-sided test on n = 25 using the same Minitab procedure. Power:....... d) Redo part a) using 1-sample t. Give n 3 =....... 3 Sample size under binomial distribution a) In the treatment of a chronic disease with an old proven drug 20% of patients experience a clear relief. One has developed a new drug and it is hoped that along with the traditional treatment will help more patients. 3

By allowing n patients to try the new combination therapy and find out how many people feel an improvement we would test the following hypothesis H 0 : p = 0.2 against H 1 : p > 0.2 on level 0.01. Moreover we want to have power of the test 0.99 if p = 0.4. Determine n using Stat/Power and Sample Size/One proportion with right H 1. Give n a =....... Look at the power function. b) Solve exercise 60 from Problem book, using Stat/Power and Sample Size/Two proportions. Give n b =....... 4 Sample size under one factor analysis Solve exercise 3-44 in Design and Analysis of Experiments Montgomery, using Stat/Power and Sample Size/ Oneway ANOVA. Give n =....... This is inconsistent with our old earnings, which is due to Minitab works with pairwise comparisons between µ i and µ j, while we have discussed F-test for H 0 : µ 1 =... = µ 4 on level 0.05. 5 Logistic regression, mixed model In 1974 and 1975 two studies have been done National Opinion Research Center, University of Chicago, Illinios where people s attitude towards women is considered. Each would be asked to consider the following statement: Women should take care of running their homes and leave running the country up to men. Observations from 1305 men and 1566 women are summarized in the table below. 4

Amount Men, j = 1 Women, j = 2 year of education, k positive negative positive negative 0 4 2 4 2 1 2 0 1 0 2 4 0 0 0 3 6 3 6 1 4 5 5 10 0 5 13 7 14 7 6 25 9 17 5 7 27 15 26 16 8 75 49 91 36 9 29 29 30 35 10 32 45 55 67 11 36 59 50 62 12 115 245 190 403 13 31 70 17 92 14 28 79 18 81 15 9 23 7 34 16 15 110 13 115 17 3 29 3 28 18 1 28 0 21 19 3 13 1 2 20 3 20 2 4 The above data are available to download on the course website. After a quick look at the data, it seems that the longer the education, the lower proportion of positive to the statement. We will now analyze the data using logistic regression and answer some questions about the length of training and gender are important. We choose the dummy variable { 0 om j = 1 (men) z j = 1 om j = 2 (women) to separate two groups men and women. Put columns y jk for the positive, x jk for the negative, dummy variable z j and amount of the education years k. There is also a column for the total number n jk = y jk + x jk respondents for each sex j and years of education k. Create a column with the percentage of positive answers ˆp jk = y jk /n jk. a) Plot the proportion of the positive answers ˆp jk against the years of education k. Choose Graph/Scatterplot/With Gropus so that we can see the difference between men and women. b) Write down model where the constant term and slope can be different for those two groups (logit p jk =...). Use the dummy variables to separate groups. (Hemuppgift) 5

Do the logit-analysis for the given model with dummy variables. Go to Stat/Regression/Binary Log... c) What are the parameters of your model that are significant? Are you satisfied with deviance? D =......... P =......... Conclusions? Non-mandatory exercise En anledning till att modellen inte är så bra kan vara att vissa celler har färre än tio observationer och påverkar resultatet mer än vad som är önskvärt. Ett sätt att hantera denna problematik skulle kunna vara att helt enkelt ta bort dessa observationer. Gör om analysen för samma modell men där alla observationer som är tio eller färre per cell är bortagna. Kopiara all data i datafönstret till nya kolumner och ta bort de som ej ska ingå (alla där n 10). Gå in under Stat/Regression/Binary Log... och gör en ny analys med de nya kolumnerna. d) Vilka parametrar i din modell är signifikanta? Är du nöjd med deviansen? D =......... P =......... Slutsats? 6 Use of dymmy variables in the additive model (non-mandatory exercise) Vid tillverkning av tvål görs en kvalitetsklassning av tvålens utseende enligt en skala från 1 till 10, ju högre värde desto bättre. Man tror att skillnader mellan operatörer samt hastigheten på produktionslinjen har betydelse. Resultat: 6

Appearance Operator Line Speed (Sum for 30 Bars) 1 150 255 1 175 246 1 200 249 2 150 260 2 175 223 2 200 231 3 150 265 3 175 247 3 200 256 Genomför en regressionsanalys svarande mot en additiv tvåfaktormodell genom att utnyttja förklaringsvariablerna { { 1 för operatör 1 1 för operatör 2 x 1 =, x 0 annars 2 =, 0 annars { { 1 för hastighet 1 1 för hastighet 2 z 1 =, z 0 annars 2 =. 0 annars Lägg in data i datafönstret och skriv in variabelnamnen i namnraden. Kalla den aktuella responsvariabeln för Y. Gå in under Stat/Regression/Regression och beställ en regressionsanalys med Y som responsvariabel och x 1, x 2, z 1, z 2 som prediktorer. Under Graphs beställer du plott av residualerna mot de skattade väntevärdena (fits) samt normalfördelningsplott av residualerna. Under Storage beställer du lagring av (X X) 1. Ta sedan OK. Titta överst i analysen var (X X) 1 har hamnat och skriv i sessionsfönstret print m1 om den finns i m1. a) Ställ upp den aktuella modellen. (Hemuppgift) b) Gör konfidensintervall för samtliga β-koefficienter vart och ett med konfidensgrad 95%. Finns det påvisbara skillnader mellan operatörer? c) Vilka parametrar beskriver skillnaden mellan hastighet 1 och 2? Punktskatta den? d) Titta på residualplottarna. e) Skapa två kolumner med nivåer för operatör respektive hastighet. 7

Gå in under Stat/ANOVA/Balanced ANOVA och genomför en analys enligt en additiv tvåfaktormodell med lagring av medelvärden för de olika faktorerna (beställs under Results). f) Ställ upp modellen. (Hemuppgift) g) Skatta skillnaderna i kvalitetsbedömningen mellan hastigheterna och jämför med motsvarande parameterskattningar i c). h) Kan vi rekommendera någon hastighet? Konstruera lämpliga konfidensintervall med simultan konfidensgrad exakt 90%. 7 Power for t-test (non-mandatory exercise) Låt x 1,..., x n vara observationer från N(µ, σ). Vi kan då pröva hypotesen H 0 ; µ = 5 mot H 1 : µ 5 med teststorheten w = x 5 s/ n. H 0 förkastas om w > t, där t ges i t(n 1)-tabell av villkoret F (t) = 0.975, då testet har nivån 0.05. Vi ska dels studera signifikansnivån, d v s P ( W > t om µ = 5), dels testets styrka då µ = 6, dvs. P ( W > t om µ = 6). Styrkan beror inte bara på det alternativa µ-värdet utan även på standardavvikelsen σ. Styrkeberäkningar är bl a intressanta då man planerar en undersökning och vill kunna bedöma hur många mätningar som behövs. För t-testet är det besvärligt att räkan på styrkan för hand och då har man nytta av simuleringar. a) Rensa fönsterna. Gå in under Calc-Random data-normal distribution och generera 1000 rader i c1-c16 med väntevärde 5 och standardavvikelse 1.2. I varje rad har man sedan 16 observationer från N(5, 1.2). Ta sedan Calc-Row Statistics, välj alternativet mean med Input Variables c1-c16 och lagra i c17. Ta sedan Calc-Row Statistics, välj alternativet stdev med Input Variables c1-c16 och lagra i c18. Beräkna teststorhetens värde för varje rad genom att skriva i sessionsfönstret let c19 = (c17-5)/(c18/4) För att få fram t-värdet kan man gå in under Calc-Probability Distribution-t; välj Inverse cumulative probability. Fyll också i Noncentrality parameter: 0.0, frihetsgrad och Input constant: 0.975. Skriv i sessions-fönstret let k1 =... let c20 = c19 < -k1 8

let c21 = c19 > k1 sum c20 sum c21 Då är sum c20 + sum c21 =......... antalet gånger nollhypotesen förkastats. Stämmer denna summa med vad ni väntade er med hänsyn till signifikansnivån? b) Rensa datafönstret, men inte sessionsfönstret. Gör om proceduren med data från N(6, 1.2). OBS! Ni ska fortfarande pröva H 0 : µ = 5. med samma teststorhet w. Med hjälp av y = sum c20 + sum c21 kan man beräkna ett approximativt värde y/1000 =......... på styrkan för µ = 6. Är ni nöjda med styrkan? c) Bestäm också styrkan genom att utnyttja lämplig rutin under Stat/Power and Sample Size. Styrkan blir......... 9