text
stringlengths
1
3.55k
source
stringlengths
24
207
emb
listlengths
1.02k
1.02k
. ” as discussed for one - sample hypothesis testing, when writing the null and alternative hypotheses, start off by translating the claim into a mathematical statement involving the unknown population parameters. the claim could correspond to either the null or the alternative hypothesis. then write the complement of ...
openstax_principles-of-data-science-web
[ -0.009004253894090652, 0.006552416831254959, -0.005892840214073658, -0.010184559039771557, -0.06120530888438225, -0.014507221058011055, 0.01206295844167471, 0.015066543594002724, 0.020026998594403267, 0.04795973002910614, 0.026022978127002716, -0.006983141414821148, 0.013005486689507961, -...
relationship between the two samples. two samples are considered to be dependent samples if the samples from one population can be paired or matched to the samples taken from the second population. dependent samples are sometimes also called paired samples. for example, if a researcher were to collect data for the ages...
openstax_principles-of-data-science-web
[ 0.0010605806019157171, 0.03219295293092728, 0.007322182413190603, -0.022492825984954834, -0.037056997418403625, 0.008741648867726326, -0.02602764032781124, -0.006047616247087717, 0.018431173637509346, 0.03719962388277054, -0.0011349570704624057, 0.009699663147330284, 0.000012679795872827526,...
4. 2 β€’ hypothesis testing 181 example 4. 18 problem determine if the following samples are dependent or independent samples : sample # 1 : blood pressure readings on a sample of 50 patients in a clinical trial before taking any medication. sample # 2 : blood pressure readings on the same group of 50 patients after taki...
openstax_principles-of-data-science-web
[ 0.023051535710692406, 0.03105928935110569, 0.021672166883945465, -0.03472822904586792, -0.07931298762559891, 0.006435776595026255, -0.0007113289320841432, -0.00039996905252337456, 0.0037397597916424274, 0.0453614704310894, 0.04832248389720917, 0.0019911080598831177, 0.020998423919081688, -...
mean sample standard deviation sample size table 4. 11 sample data for women and men engineers use this sample data to test the claim made by the software engineer. use a level of significance of 0. 05 for this analysis. solution the first step in the hypothesis testing procedure is to write the null and alternative hy...
openstax_principles-of-data-science-web
[ 0.01563328318297863, 0.022373531013727188, 0.015164672397077084, -0.045476123690605164, -0.05209002643823624, -0.018808288499712944, 0.03958537057042122, 0.009842381812632084, -0.015387985855340958, 0.0739763155579567, 0.03133833035826683, 0.006460919044911861, 0.021558862179517746, -0.021...
value with the level of significance. in this example, the p - value is 0. 025 and the level of significance is 0. 04 : since the p - value level of significance, then the decision is to β€œ reject the null hypothesis. ” conclusion : the decision is to reject the null hypothesis ; the claim corresponds to the alternative...
openstax_principles-of-data-science-web
[ 0.020439671352505684, 0.017541080713272095, -0.004940655082464218, -0.03251274302601814, -0.0486455038189888, -0.020814137533307076, 0.01698010228574276, 0.016359727829694748, -0.015619061887264252, 0.07647320628166199, 0.005786019377410412, -0.016074163839221, 0.019502053037285805, 0.0019...
4. 2 β€’ hypothesis testing 183 for the function ttest _ ind _ from _ stats ( ), the syntax is as follows : stats. ttest _ ind _ from _ stats ( sample _ mean1, sample _ standard _ deviation1, sample _ size1, sample _ mean2, sample _ standard _ deviation2, sample _ size2 ) here is the python code that can be used to solve...
openstax_principles-of-data-science-web
[ 0.012717909179627895, 0.02833707444369793, 0.03548808768391609, -0.03643428534269333, -0.06239708140492439, -0.029269658029079437, 0.0009439080022275448, 0.022115640342235565, -0.010042700916528702, 0.05060753598809242, -0.014731607399880886, 0.0019116001203656197, -0.00045653287088498473, ...
two independent samples. in this section, we turn our attention to hypothesis testing for dependent samples, often called matched pairs, paired samples, or paired data. recall that two samples are considered to be dependent if the samples from one population can be paired, or matched, to the samples taken from the seco...
openstax_principles-of-data-science-web
[ -0.012036986649036407, 0.03839040920138359, 0.01582179218530655, -0.025642717257142067, -0.07119894027709961, -0.012732363305985928, -0.02809194102883339, -0.00473991222679615, 0.007362521719187498, 0.02917568013072014, -0.005551659036427736, 0.013467682525515556, -0.008783027529716492, -0...
, the degrees of freedom will be, where is the number of data pairs.
openstax_principles-of-data-science-web
[ 0.008762955665588379, 0.009468238800764084, 0.010558024048805237, 0.0018802023259922862, -0.041192442178726196, -0.012801624834537506, 0.00654811505228281, 0.007995259948074818, 0.010901880450546741, 0.03108329512178898, 0.03522111475467682, 0.03587935119867325, -0.004662501625716686, 0.00...
4. 2 β€’ hypothesis testing 185 the setup of the null and alternative hypotheses will follow one of the setups shown in table 4. 12 : setup a setup b setup c table 4. 12 possible setups for null and alternative hypothesis for paired data hypothesis testing example 4. 20 illustrates this hypothesis testing process. exampl...
openstax_principles-of-data-science-web
[ 0.008199317380785942, 0.008524089120328426, 0.026089182123541832, -0.0038148080930113792, -0.06968873739242554, -0.0074997893534600735, -0.003791104769334197, 0.01064499095082283, -0.022718282416462898, 0.059980493038892746, 0.03682289272546768, 0.016532104462385178, -0.0012203683145344257, ...
the setup 186 4 β€’ inferential statistics and regression analysis access for free at openstax. org of the null and alternative hypotheses will be as follows : the mean of the differences is average of the differences column shown in table 4. 13. the mean of the differences column is 13. 9, and the standard deviation of ...
openstax_principles-of-data-science-web
[ 0.016164744272828102, 0.018604295328259468, 0.027042297646403313, -0.008874860592186451, -0.058667127043008804, -0.010825459845364094, 0.014235525391995907, 0.010167425498366356, -0.02242189459502697, 0.08279771357774734, 0.02609839104115963, 0.00530620664358139, -0.00794290006160736, -0.0...
for the first group and refers to the population proportion for the second group. a researcher will take samples from the two populations and then calculate two sample proportions ( ) as follows : where : is the number of successes in the first sample. is the sample size for the first sample. is the number of successes...
openstax_principles-of-data-science-web
[ 0.0061510405503213406, 0.026717903092503548, -0.029662447050213814, -0.034183211624622345, -0.040051769465208054, -0.023385005071759224, -0.016839144751429558, 0.042520493268966675, 0.024497216567397118, 0.032398521900177, 0.012356653809547424, -0.0352819599211216, -0.006132235750555992, 0...
4. 2 β€’ hypothesis testing 187 here are the requirements to use this procedure : a. the samples are random and independent. b. sample sizes are large enough to use a normal distribution as an approximation for a binomial distribution. to confirm this, ensure that the following four quantities are all at least 5 :,,, whe...
openstax_principles-of-data-science-web
[ 0.016695361584424973, 0.007196854799985886, 0.04794587194919586, -0.008304858580231667, -0.039309486746788025, -0.00367595162242651, -0.00023509043967351317, 0.014480290934443474, -0.023291056975722313, 0.07840383052825928, 0.07017581909894943, -0.012726837769150734, -0.000536806124728173, ...
assumes there is no difference in the two proportions such that is equal to ( which can also be considered as ). this setup will correspond to setup e from table 4. 10. the claim corresponds to the alternative hypothesis. thus the setup of the null and alternative hypotheses will be as follows : first, check that the r...
openstax_principles-of-data-science-web
[ 0.029220527037978172, 0.01779867894947529, 0.03781147301197052, -0.012585156597197056, -0.04747246950864792, -0.007281820755451918, -0.0071669030003249645, 0.030168337747454643, -0.017423445358872414, 0.06453734636306763, 0.04199209809303284, -0.018626412376761436, -0.0007115643238648772, ...
the placebo. this indicates that the medication is effective in addressing lung cancer.
openstax_principles-of-data-science-web
[ 0.012483724392950535, 0.0013629049062728882, 0.021977756172418594, -0.008334442041814327, -0.018268750980496407, -0.012175951153039932, -0.006159938871860504, 0.017571358010172844, 0.02385370433330536, 0.01530046109110117, 0.03911716118454933, -0.0011366934049874544, 0.024105899035930634, ...
4. 3 correlation and linear regression analysis learning outcomes by the end of this section, you should be able to : β€’ 4. 3. 1 create scatterplots and calculate and interpret correlation coefficients. β€’ 4. 3. 2 perform linear regression and determine the best - fit linear equation. β€’ 4. 3. 3 use python to calculate co...
openstax_principles-of-data-science-web
[ 0.010003086179494858, 0.020857201889157295, -0.004407909698784351, -0.009101548232138157, -0.007001501973718405, 0.016715599223971367, 0.0010137740755453706, -0.016639184206724167, 0.022387078031897545, 0.04710233956575394, 0.00805688463151455, 0.011026092804968357, -0.008595637045800686, ...
4. 3 β€’ correlation and linear regression analysis 189 responds to those changes. regression analysis takes this a step further by quantifying the relationship between the two variables, and it can be used to predict one quantity based on a second quantity, assuming there is a significant correlation between the two qua...
openstax_principles-of-data-science-web
[ -0.013662056066095829, 0.05297979712486267, 0.0199628584086895, -0.0021988593507558107, -0.039242763072252274, 0.017459433525800705, 0.006403857842087746, -0.020353062078356743, 0.04139383137226105, 0.055055320262908936, -0.00265989126637578, 0.011164027266204357, -0.027862198650836945, -0...
can be collected for nike stock prices and value of the s & p 500 for a period of time, and a scatterplot can be created and examined. a scatterplot, or scatter diagram, is a graphical display intended to show the relationship between two variables. the setup of the scatterplot is that one variable is plotted on the ho...
openstax_principles-of-data-science-web
[ -0.0005460370448417962, 0.04287057742476463, 0.014568285085260868, 0.009674816392362118, -0.0037852830719202757, 0.0011201706947758794, 0.021417254582047462, -0.02338307723402977, 0.027170633897185326, 0.0417824387550354, -0.0005531870410777628, 0.034640535712242126, -0.0016710493946447968, ...
140. 45 table 4. 14 nike stock price ( $ ) and value of s & p 500 over a one - year time period ( source : yahoo! finance ) to assess linear correlation, examine the graphical trend of the data points on the scatterplot to determine if a straight - line pattern exists ( see figure 4. 5 ). if a linear pattern exists, th...
openstax_principles-of-data-science-web
[ 0.003499322570860386, 0.06417395174503326, 0.020056016743183136, 0.0329345241189003, 0.011978913098573685, -0.0013571924064308405, 0.04131427779793739, -0.009563650004565716, 0.005693734157830477, 0.07559914886951447, 0.02290443703532219, 0.012222349643707275, -0.026307322084903717, -0.015...
indicates to sum the x - values. note that this value of β€œ ” is sometimes referred to as the β€œ pearson correlation coefficient. ” table 4. 15 provides a step - by - step procedure on how to calculate the correlation coefficient.
openstax_principles-of-data-science-web
[ 0.030884932726621628, -0.003868342377245426, 0.030731337144970894, 0.041223540902137756, -0.008384451270103455, -0.010823661461472511, 0.033456090837717056, -0.01924470253288746, -0.0076532140374183655, 0.045562781393527985, 0.0340394452214241, 0.011388116516172886, -0.022220280021429062, ...
4. 3 β€’ correlation and linear regression analysis 191 step representation in symbols 1. calculate the sum of the x - values. 2. calculate the sum of the y - values. 3. multiply each x - value by the corresponding y - value and calculate the sum of these products. 4. square each x - value and then calculate the sum of t...
openstax_principles-of-data-science-web
[ 0.004760219715535641, 0.05037635564804077, 0.029718948528170586, 0.008171267807483673, 0.025221029296517372, -0.0054977587424218655, 0.02745143510401249, -0.001009613391943276, -0.0015725349076092243, 0.04437287524342537, 0.013452116400003433, 0.0002888580784201622, 0.00023394521849695593, ...
63, 3756. 07, 3714. 24, 3811. 15, 3943. 34 ] ) nike = np. array ( [ 87. 18, 98. 58, 98. 05, 97. 61, 111. 89, 125. 54, 120. 08, 134. 70, 141. 47, 133. 59, 134. 78, 140. 45 ] ) # pearson r returns both value of r and corresponding p - value python code 192 4 β€’ inferential statistics and regression analysis access for fre...
openstax_principles-of-data-science-web
[ 0.010338466614484787, 0.03380100429058075, 0.024544548243284225, 0.05450473725795746, -0.017435943707823753, -0.005351249128580093, 0.0582747682929039, 0.0021559062879532576, -0.018781863152980804, 0.039829377084970474, 0.023204680532217026, 0.015020155347883701, -0.019684311002492905, -0....
indicates that the relationship between nike stock and the value of the s & p 500 over this time period represents a strong, positive correlation. test a correlation coefficient for significance the correlation coefficient,, tells us about the strength and direction of the linear relationship between and. the sample da...
openstax_principles-of-data-science-web
[ 0.026174578815698624, 0.08303485065698624, 0.015491897240281105, 0.03931766748428345, -0.010640859603881836, 0.012163308449089527, 0.023168018087744713, -0.016837719827890396, 0.03503728285431862, 0.06746494024991989, 0.039496298879384995, -0.008443591184914112, -0.009681278839707375, -0.0...
4. 3 β€’ correlation and linear regression analysis 193 if the test concludes that the correlation coefficient is significantly different from zero, we say that the correlation coefficient is significant. β€’ conclusion : there is sufficient evidence to conclude that there is a significant linear relationship between the t...
openstax_principles-of-data-science-web
[ 0.025558186694979668, 0.043821804225444794, 0.024057680740952492, -0.0009856894612312317, -0.024078423157334328, 0.008210377767682076, -0.014178144745528698, -0.0005341686774045229, 0.006666109897196293, 0.07788444310426712, 0.0263841412961483, -0.00706501817330718, -0.016560321673750877, ...
the significance of the sample correlation coefficient β€’ if is significant and the scatterplot shows a linear trend, the line can be used to predict the value of for values of that are within the domain of observed x - values. β€’ if is not significant or if the scatterplot does not show a linear trend, the line should n...
openstax_principles-of-data-science-web
[ 0.008846326731145382, 0.050569966435432434, 0.024920852854847908, 0.010497922077775002, -0.023612018674612045, 0.001783438608981669, 0.02103864960372448, -0.024947742000222206, 0.011601941660046577, 0.07353869825601578, 0.014165299013257027, -0.003450962947681546, -0.012959896586835384, -0...
is established, then the business manager can predict sales based on the amount spent on advertising for a given period. in this discussion we will focus on linear regression, where a straight line is used to model the relationship between the two variables. once a straight - line model is developed, this model can the...
openstax_principles-of-data-science-web
[ -0.005051889922469854, 0.05760464444756508, -0.00013975705951452255, -0.009675823152065277, -0.012152518145740032, 0.0360516682267189, 0.045910127460956573, 0.010490462183952332, 0.03209155425429344, 0.07042130082845688, 0.010157810524106026, -0.00045293214498087764, -0.019292043522000313, ...
4. 3 β€’ correlation and linear regression analysis 195 figure 4. 6 three examples of graphs of. ( a ) if, the line slopes upward to the right. ( b ) if, the line is horizontal. ( c ) if, the line slopes downward to the right. when generating the equation of a line in algebra using, two points were required to generate t...
openstax_principles-of-data-science-web
[ -0.001396668842062354, 0.044210419058799744, 0.013320788741111755, -0.006222203373908997, -0.02314695715904236, -0.01989712379872799, 0.012740598060190678, 0.019989244639873505, 0.014159961603581905, 0.05098738148808479, 0.015396506525576115, 0.015096762217581272, -0.006682717241346836, -0...
for : 196 4 β€’ inferential statistics and regression analysis access for free at openstax. org this predicted value of indicates that the anticipated revenue would be $ 18, 646, 700, given the advertising spend of $ 150, 000. notice that from past data, there may have been a month where the company actually did spend $ ...
openstax_principles-of-data-science-web
[ -0.009928164072334766, 0.0416150763630867, -0.011255399323999882, -0.0018335102358832955, -0.023893970996141434, -0.02263561822474003, 0.006339493207633495, -0.012817418202757835, 0.006681237835437059, 0.04479236155748367, 0.037438247352838516, 0.00613096309825778, 0.0006473495159298182, -...
a corporation has created a linear model for the relationship between the company stock and interest rates. when interest rates are at 5 %, the company stock has a value of $ 94. using the linear model, when interest rates are at 5 %, the model predicts the value of the company stock to be $ 99. calculate the residual ...
openstax_principles-of-data-science-web
[ -0.0017352967988699675, 0.07045001536607742, 0.018594153225421906, -0.0049214353784918785, -0.03036455437541008, 0.009566230699419975, 0.044892068952322006, -0.02852785587310791, 0.026147225871682167, 0.045906808227300644, 0.018871035426855087, 0.01735229231417179, -0.006827188190072775, -...
4. 3 β€’ correlation and linear regression analysis 197 formulas : where refers to the number of data pairs and indicates sum of the x - values. notice that the formula for the y - intercept requires the use of the slope result ( b ), and thus the slope should be calculated first, and the y - intercept should be calculat...
openstax_principles-of-data-science-web
[ 0.00803305022418499, 0.02824605442583561, 0.010628923773765564, 0.008493057452142239, -0.02633039653301239, -0.004757419228553772, 0.024558233097195625, -0.010986609384417534, 0.03412416949868202, 0.0447826124727726, -0.0022815740667283535, -0.012273881584405899, 0.006738646421581507, -0.0...
linear relationship in the population that models the average value of for varying values of. in other words, the expected value of for each particular value lies on a straight line in the population. ( we do not know the equation for the line for the population. our regression line from the sample is our best estimate...
openstax_principles-of-data-science-web
[ -0.007487822789698839, 0.05246364325284958, -0.006976643111556768, 0.0001986655843211338, -0.007193941622972488, -0.007213007193058729, 0.033151574432849884, -0.0036617591977119446, 0.019332753494381905, 0.058310069143772125, 0.003936144057661295, 0.008601190522313118, -0.002722685458138585,...
the following analysis based on a given dataset of data. β€’ create a scatterplot. β€’ calculate the correlation coefficient. β€’ construct the best - fit linear equation. β€’ predict values of the dependent variable for given values of the independent variable. there are various ways to accomplish these tasks in python, but w...
openstax_principles-of-data-science-web
[ 0.014624154195189476, 0.03767477720975876, -0.012452115304768085, -0.011004473082721233, 0.0034526747185736895, -0.012113665230572224, 0.008961277082562447, -0.01254044659435749, 0.015769416466355324, 0.02997414767742157, -0.02053172141313553, -0.005007599480450153, 0.008424517698585987, -...
4. 3 β€’ correlation and linear regression analysis 199 d. construct a linear regression model. e. use the model to predict the revenue for a certain month where the amount spent on advertising is $ 100. month advertising spend revenue jan 49 12210 feb 145 17590 mar 57 13215 apr 153 19200 may 92 14600 jun 83 14100 jul 11...
openstax_principles-of-data-science-web
[ -0.0046722120605409145, 0.04904719814658165, -0.006962326355278492, -0.029859524220228195, -0.006750089582055807, -0.01233504619449377, -0.015401821583509445, -0.002170676365494728, 0.009292028844356537, 0.031039774417877197, -0.01846281997859478, 0.019835133105516434, 0.020959259942173958, ...
) # add labels to the x and y axes by using xlabel and ylabel functions plt. xlabel ( " advertising $ 000 " ) plt. ylabel ( " revenue $ 000 " ) the resulting output will look like this : b. the python function pearsonr ( ) can be used to generate the correlation coefficient,. here is the python code to calculate the co...
openstax_principles-of-data-science-web
[ 0.004634450189769268, 0.015769479796290398, 0.002787591889500618, -0.0007820414029993117, 0.004016177728772163, -0.03602532297372818, 0.030060505494475365, -0.029150022193789482, 0.0012731479946523905, 0.024356214329600334, 0.015510141849517822, -0.028493160381913185, 0.012906821444630623, ...
4. 3 β€’ correlation and linear regression analysis 201 # define the x - data, which is amount spent on advertising x = [ 49, 145, 57, 153, 92, 83, 117, 142, 69, 106, 109, 121 ] # define the y - data, which is revenue y = [ 12210, 17590, 13215, 19200, 14600, 14100, 17100, 18400, 14100, 15500, 16300, 17020 ] # pearson r r...
openstax_principles-of-data-science-web
[ 0.01711292378604412, 0.023222187533974648, 0.023203887045383453, 0.024402210488915443, -0.01965244486927986, -0.0023559911642223597, 0.03730916604399681, -0.00785311684012413, -0.026632076129317284, 0.035251688212156296, 0.023855287581682205, 0.023021889850497246, -0.004051924683153629, -0...
0. 05 level of significance. in this example, we check if is greater than or equal to where. since is approximately 0. 577, this indicates that the r - value of 0. 981 is greater than, and thus the correlation is deemed significant. d. the linear regression model will be of the form : to determine the slope and y - int...
openstax_principles-of-data-science-web
[ 0.011102456599473953, 0.033846013247966766, -0.013688445091247559, 0.005756396800279617, -0.009957130998373032, -0.003491111332550645, 0.03390831500291824, 0.0158755611628294, -0.01171350758522749, 0.050377946346998215, 0.025998998433351517, 0.01792088896036148, 0.0040762899443507195, -0.0...
in thousands of dollars ). it is also useful to plot this best - fit line superimposed on the scatterplot to show the strong correlation between advertising spend and revenue, as follows ( see figure 4. 9 ) :
openstax_principles-of-data-science-web
[ 0.017860710620880127, 0.038512155413627625, -0.012076565064489841, 0.05190901458263397, 0.004428617190569639, -0.032101117074489594, 0.0020350709091871977, -0.036264460533857346, 0.02783108688890934, 0.004536042455583811, 0.03089398518204689, -0.003093919949606061, 0.008651115000247955, -0...
4. 3 β€’ correlation and linear regression analysis 203 figure 4. 9 best - fit line superimposed on the scatterplot e. the regression equation is :. the given amount of advertising spend of $ 100 corresponds to a given x - value, so replace β€œ ” with 100 in this regression equation to generate a predicted revenue : since ...
openstax_principles-of-data-science-web
[ -0.012818673625588417, 0.03915315493941307, -0.00768602080643177, 0.012499110773205757, -0.01896422728896141, -0.038056835532188416, 0.034548185765743256, 0.03254019841551781, -0.008313136175274849, 0.0358721986413002, 0.049246788024902344, 0.0321512371301651, 0.0011375955073162913, 0.0119...
x - value of zero is outside the range of the - data that was collected. in this case, we should not assign any interpretation to the y - intercept. in the previous example, the range of data collected for the - variable was from $ 49, 000 to $ 153, 000 spent per month on advertising. since this interval does not inclu...
openstax_principles-of-data-science-web
[ -0.006887331139296293, 0.026845945045351982, 0.0026648647617548704, 0.0036419301759451628, -0.04007874056696892, -0.05343784764409065, 0.025797123089432716, 0.049085646867752075, -0.0012366781011223793, 0.08267970383167267, 0.06064436957240105, 0.018633216619491577, 0.019153758883476257, -...
4. 4 analysis of variance ( anova ) learning outcomes by the end of this section, you should be able to : β€’ 4. 4. 1 set up and apply one - way analysis of variance hypothesis test. β€’ 4. 4. 2 use python to conduct one - way analysis of variance. in testing claims based on one sample, we reviewed methods to conduct hypot...
openstax_principles-of-data-science-web
[ 0.030985618010163307, 0.041178569197654724, -0.009058904834091663, -0.03694476932287216, -0.06594041734933853, 0.003660161281004548, 0.010145405307412148, -0.009584345854818821, -0.0025434866547584534, 0.06413747370243073, 0.02881513349711895, 0.009074107743799686, 0.01287137158215046, -0....
are approximately equal. in this discussion, we assume that the population variances are not equal. when these requirements are met, the f - distribution is used as the basis for conducting the hypothesis test. the f - distribution is a skewed distribution ( skewed to the right ), and the shape of the distribution depe...
openstax_principles-of-data-science-web
[ 0.00005824707113788463, 0.024146562442183495, 0.009036233648657799, -0.01601157709956169, -0.06600849330425262, 0.01510391291230917, -0.0056011863052845, -0.006162610836327076, -0.041085898876190186, 0.07837826013565063, 0.0520450659096241, -0.004639612510800362, 0.02504458837211132, -0.01...
4. 4 β€’ analysis of variance ( anova ) 205 figure 4. 10 shows the typical shape of the f - distribution : figure 4. 10 shape of the f - distribution the test statistic for this hypothesis test will be the ratio of two variances, namely the ratio of the variance between samples to the ratio of the variances within the sa...
openstax_principles-of-data-science-web
[ -0.0068618375808000565, 0.03744444251060486, 0.02981516346335411, -0.02126779779791832, -0.03132898733019829, 0.014683492481708527, 0.038925230503082275, 0.002146366983652115, -0.026045378297567368, 0.05676592141389847, 0.033200256526470184, 0.004245728254318237, -0.007395080290734768, -0....
the numerator would be. for degrees of freedom for the denominator, this is calculated as the total of the sample sizes minus the number of groups. 206 4 β€’ inferential statistics and regression analysis access for free at openstax. org 6. calculate the quantity called β€œ mean square between ( msb ) ” according to the fo...
openstax_principles-of-data-science-web
[ 0.024373803287744522, 0.03169838711619377, 0.022872919216752052, -0.016180135309696198, -0.04429270699620247, -0.01855831779539585, 0.026600176468491554, -0.006453848443925381, -0.02104870229959488, 0.06384452432394028, 0.029886238276958466, 0.007569037843495607, -0.015818322077393532, -0....
anova hypothesis testing process. example 4. 25 problem an airline manager claims that the average arrival delays for flights from boston to dallas are the same for three airlines : airlines a, b, and c. the following arrival delay data ( in minutes ) is collected on samples of flights for the three airlines ( table 4....
openstax_principles-of-data-science-web
[ 0.030340345576405525, 0.04578603431582451, 0.028066832572221756, -0.04348868504166603, -0.016634652391076088, -0.005220324266701937, -0.013822519220411777, -0.008537008427083492, 0.029673371464014053, 0.09005303680896759, 0.012056008912622929, 0.015576816163957119, -0.03656889498233795, -0...
4. 4 β€’ analysis of variance ( anova ) 207 airline a airline b airline c 8 13 11 12 0 15 7 2 9 9 7 11 11 6 12 4 5 n / a table 4. 18 arrival delay data ( in minutes ) for three airlines use this sample data to test the claim that the average arrival delays are the same for three airlines : airlines a, b, and c. use a lev...
openstax_principles-of-data-science-web
[ 0.020297342911362648, 0.04649568349123001, 0.011504101566970348, -0.029080886393785477, -0.03366134688258171, 0.006152294110506773, -0.0033705250825732946, -0.005474389065057039, 0.0033353709150105715, 0.0633455142378807, -0.0006853168597444892, -0.0026179749984294176, -0.008468265645205975,...
##828, pvalue = 0. 03314999857295516 ) from this python output, the test statistic is and the p - value is 0. 033. the final step in the hypothesis testing procedure is to come to a final decision regarding the null hypothesis. this is accomplished by comparing the p - value with the level of significance. in this exam...
openstax_principles-of-data-science-web
[ 0.02314169704914093, 0.03815098851919174, 0.02582073211669922, -0.023406803607940674, -0.04128499701619148, -0.0040112645365297794, 0.0013198265805840492, -0.0006078106234781444, 0.0009409645572304726, 0.07396268844604492, -0.003921634051948786, 0.0028467015363276005, -0.008286743424832821, ...
4. 4 β€’ analysis of variance ( anova ) 209 key terms alternative hypothesis a complementary statement regarding an unknown population parameter used in hypothesis testing analysis of variance ( anova ) statistical method to compare three or more means and determine if the means are all statistically the same or if at le...
openstax_principles-of-data-science-web
[ 0.00028007038054056466, 0.04063825681805611, 0.024563146755099297, -0.003434869460761547, -0.051601823419332504, 0.006189105100929737, 0.030357880517840385, 0.003205379005521536, 0.022121161222457886, 0.060224492102861404, 0.029814356938004494, 0.001998745836317539, -0.029983794316649437, ...
of the independent variable is controlled or chosen by the experimenter to observe its effect on the dependent variable inferential statistics statistical methods that allow researchers to infer or generalize observations from samples to the larger population from which they were selected least squares method a method ...
openstax_principles-of-data-science-web
[ -0.023327486589550972, 0.05347203463315964, 0.016439037397503853, -0.023467930033802986, -0.03658892959356308, 0.005778392311185598, 0.0175891425460577, -0.009901858866214752, 0.013445147313177586, 0.025171253830194473, 0.015155595727264881, -0.0020868738647550344, -0.006090350914746523, -...
proportion a measure that expresses the relationship between a part and the whole ; a proportion represents the fraction or percentage of a dataset that exhibits a particular characteristic or falls into a specific category regression analysis a statistical technique used to model the relationship between a dependent v...
openstax_principles-of-data-science-web
[ -0.01106908731162548, 0.00978949386626482, -0.007861816324293613, -0.02115708217024803, -0.016641156747937202, -0.02800726518034935, 0.039951592683792114, 0.012231755070388317, -0.005968294106423855, 0.0432053841650486, 0.0464460551738739, -0.027773907408118248, -0.0061569903045892715, 0.0...
a researcher rejects the null hypothesis when in fact the null hypothesis is actually true type ii error an error made in hypothesis testing where a researcher fails to reject the null hypothesis when the null hypothesis is actually false unbiased estimator a statistic that provides a valid estimate for the correspondi...
openstax_principles-of-data-science-web
[ 0.029698451980948448, 0.04871203750371933, 0.007269500754773617, -0.022511634975671768, -0.004734373185783625, 0.006907360628247261, 0.01243998110294342, 0.006074158940464258, 0.02753448113799095, 0.08970067650079727, 0.042535558342933655, -0.018559735268354416, 0.02356645092368126, -0.039...
calculate the correlation coefficient. test the correlation coefficient for significance. if the correlation is significant, develop a linear regression model to predict a car ’ s price based on age of the vehicle. quantitative problems 1. an automotive designer wants to create a 90 % confidence interval for the mean l...
openstax_principles-of-data-science-web
[ 0.04186704754829407, 0.06085885688662529, 0.025124188512563705, 0.009289727546274662, -0.0023230791557580233, -0.008851503022015095, 0.03335173428058624, -0.006699365563690662, -0.003510216251015663, 0.05769438296556473, 0.04212310165166855, -0.019654350355267525, 0.0055158198811113834, -0...
wear seat belts. a local police agency states that the percentage of drivers wearing seat belts is at least 70 %. to test the claim, the consumer group selects a random sample of 150 drivers and finds that 117 are wearing seat belts. 212 4 β€’ group project access for free at openstax. org a. calculate the p - value for ...
openstax_principles-of-data-science-web
[ 0.041720516979694366, 0.0586811862885952, 0.047034893184900284, 0.001715409685857594, -0.01673903688788414, -0.02658749744296074, 0.0022917971946299076, -0.011977027170360088, 0.010085620917379856, 0.052876066416502, 0.00679036695510149, 0.004144798032939434, 0.029911775141954422, -0.01677...
cash flow a. calculate the correlation coefficient for this data ( all dollar amounts are in thousands ) using python. b. calculate the correlation coefficient using excel. c. determine if the correlation is significant using a significance level of 0. 05. d. construct the best - fit linear equation for this dataset. e...
openstax_principles-of-data-science-web
[ 0.043939583003520966, 0.05122688040137291, 0.019712071865797043, -0.008649788796901703, -0.020756592974066734, -0.016753051429986954, 0.010727204382419586, -0.012383755296468735, 0.0038275225088000298, 0.05412231385707855, -0.02062002196907997, 0.015528056770563126, 0.01360361184924841, -0...
0 ) chapter outline 5. 1 introduction to time series analysis 5. 2 components of time series analysis 5. 3 time series forecasting methods
openstax_principles-of-data-science-web
[ -0.014144870452582836, 0.05005819350481033, 0.00012292420433368534, -0.040457312017679214, -0.0005324569065123796, 0.015027334913611412, -0.01803210936486721, 0.014210425317287445, 0.005375445354729891, 0.08125200122594833, -0.010379806160926819, 0.019604958593845367, -0.02283061482012272, ...
5. 4 forecast evaluation methods introduction the future can be very unpredictable. wouldn ’ t it be wonderful to know whether a given stock price will rise or fall in value over the next year, which baseball team will win the next world series, or if it might rain on the particular day that you happen to be planning t...
openstax_principles-of-data-science-web
[ 0.006040044128894806, 0.07710317522287369, -0.005574824754148722, -0.04760530963540077, 0.011590342968702316, -0.0025990111753344536, -0.038888052105903625, 0.005498749203979969, 0.030648883432149887, 0.0820530578494072, 0.020142048597335815, -0.0327024944126606, 0.0020744011271744967, 0.0...
5. 1 introduction to time series analysis learning outcomes by the end of this section, you should be able to : β€’ 5. 1. 1 define time series data. β€’ 5. 1. 2 identify examples of time series data in real - world applications. data can change over time, and it is important to be able to identify the ways that the data ma...
openstax_principles-of-data-science-web
[ -0.006362368818372488, 0.06992767751216888, 0.009850970469415188, -0.024382710456848145, 0.0019217730732634664, 0.008559422567486763, -0.045725032687187195, 0.0135826850309968, 0.02397134341299534, 0.0886351615190506, 0.009981125593185425, -0.02463521622121334, 0.0041189780458807945, -0.01...
. for example, if a family ’ s spending patterns increase significantly beyond predicted levels, this could indicate either a sudden increase in household earnings or potential fraud. β€’ health care and epidemiology. time series analysis is often used to monitor patient ’ s vitals, study how cancer progresses in individ...
openstax_principles-of-data-science-web
[ -0.014584786258637905, 0.06578737497329712, -0.017497697845101357, -0.022558780387043953, 0.01722724363207817, -0.004456961993128061, -0.043320849537849426, 0.020891239866614342, 0.027741340920329094, 0.11124058812856674, 0.016323784366250038, -0.026980537921190262, 0.008170980028808117, -...
find that you must create numerous models and variations on those models before you are satisfied with the result. 5. model evaluation. this is perhaps the most important step. any model that you create will be limited in its usefulness if it is not accurate enough. the model should include some indication of how confi...
openstax_principles-of-data-science-web
[ 0.010539969429373741, 0.05761248618364334, 0.018041739240288734, -0.027000363916158676, 0.020073741674423218, 0.010228969156742096, -0.008395730517804623, 0.010531819425523281, 0.04448087885975838, 0.08439633995294571, 0.03313952311873436, 0.00549993384629488, 0.009895049035549164, -0.0277...
4769. 83 table 5. 1 s & p index values from 2013 through 2023 ( source : https : / / www. nasdaq. com / market - activity / index / spx / historical ) while the table is informative, it is not particularly easy to use to find trends or make predictions. a visualization would be better. figure 5. 2 displays the time ser...
openstax_principles-of-data-science-web
[ -0.011920097284018993, 0.04650658741593361, 0.045412708073854446, 0.015070711262524128, 0.013230477459728718, -0.010906806215643883, 0.024412851780653, -0.007671348284929991, 0.03641452267765999, 0.0987807884812355, 0.017835544422268867, -0.009771166369318962, -0.013993477448821068, -0.009...
5. 1 β€’ introduction to time series analysis 217 sequence ( takes on all index values from 1 to ). that is, we will use the standard term time series to refer to a sequence of time - labeled data and use the term sequence when discussing the terms of the time series as an ordered list of values. not every sequence of da...
openstax_principles-of-data-science-web
[ -0.021878384053707123, 0.040854815393686295, 0.015946032479405403, -0.02593209035694599, 0.012434680946171284, -0.005748972296714783, -0.035597529262304306, -0.006008566822856665, 0.010796049609780312, 0.08130715787410736, 0.0009406930184923112, 0.009603703394532204, 0.003952736500650644, ...
often denoted by the greek letter, called β€œ epsilon ” ) into the model. moreover, instead of expecting the model to produce the next term exactly, the model generates predicted values. often, the predicted values of a times series are denoted by to distinguish them from the actual values. thus, in time series forecasti...
openstax_principles-of-data-science-web
[ -0.043508484959602356, 0.056471019983291626, -0.030972765758633614, -0.02983907423913479, -0.021116087213158607, -0.0035226561594754457, 0.021122295409440994, -0.008696876466274261, 0.008429070003330708, 0.05848757177591324, 0.02306181751191616, -0.02210286073386669, -0.011097424663603306, ...
which will be defined explicitly in components of time series analysis. for now, let ’ s illustrate the idea intuitively. suppose we used the average of the most recent terms to estimate the next term. the time series model would be : based on the data in table 5. 1, the prediction for the s & p index value at the end ...
openstax_principles-of-data-science-web
[ -0.0038303674664348364, 0.06397204101085663, -0.005624616984277964, -0.005260737147182226, 0.010972997173666954, 0.03203512728214264, -0.009182569570839405, -0.015760095790028572, 0.03398827090859413, 0.09536444395780563, 0.015176978893578053, -0.02439664863049984, -0.017736108973622322, -...
, and the autoregressive
openstax_principles-of-data-science-web
[ 0.01737387664616108, 0.02638111263513565, 0.002824026858434081, 0.008247464895248413, -0.020389022305607796, 0.005637820810079575, -0.037315770983695984, -0.010226345621049404, 0.03758317604660988, 0.048309266567230225, 0.014009049162268639, -0.01490714680403471, -0.04704952612519264, -0.0...
5. 1 β€’ introduction to time series analysis 219 integrated moving average ( arima ) model. however, creating a fancy model for time series data is only part of the process. an essential part of the process is testing and evaluating your model. thus, we will also explore measures of error and uncertainty that can determ...
openstax_principles-of-data-science-web
[ -0.010377214290201664, 0.07833408564329147, 0.023212475702166557, -0.037794727832078934, 0.020641904324293137, 0.00520520331338048, 0.008257959969341755, -0.013678329065442085, 0.03471798449754715, 0.10366471856832504, 0.021535692736506462, -0.011881385929882526, -0.0014008580474182963, -0...
may be used to pick up on the seasonal variations and then, after taking those variations into account, may find that the overall trend for temperatures is rising or falling in the long term. sales data may be measured weekly or monthly. this kind of data is useful in identifying peak sales periods and slumps when cust...
openstax_principles-of-data-science-web
[ 0.0017149265622720122, 0.05301303789019585, 0.032293420284986496, -0.005863185040652752, 0.0008932677446864545, 0.018357783555984497, -0.008799013681709766, -0.003136822720989585, 0.03820965811610222, 0.084744393825531, -0.011138168163597584, -0.014314558357000351, 0.007357040885835886, -0...
2014 through 2024 from the dataset sp500. csv ( https : / / openstax. org / r / sp500 ). import pandas as pd import matplotlib. pyplot as plt import matplotlib. ticker as ticker # read the csv file into a pandas dataframe df = pd. read _ csv ('sp500. csv') # create a plot fig, ax = plt. subplots ( ) df. plot ( ax = ax ...
openstax_principles-of-data-science-web
[ 0.040537428110837936, 0.0024580927565693855, 0.0370456837117672, 0.024426523596048355, -0.0014525367878377438, -0.004277902655303478, 0.01823657564818859, -0.0086787985637784, 0.05626247450709343, 0.04940412566065788, -0.007729520555585623, -0.04061565548181534, -0.0032078144140541553, 0.0...
5. 1 β€’ introduction to time series analysis 221 # display the plot plt. show ( ) the resulting output will look like this : notice that the simple plot feature did not label the or axes. moreover, the x - axis does not show actual dates, but instead the number of time steps. for simple visualizations that you do not in...
openstax_principles-of-data-science-web
[ 0.016981996595859528, 0.027983451262116432, 0.006822036579251289, -0.025940215215086937, 0.010440303944051266, 0.0025682970881462097, -0.012598109431564808, 0.0034992557484656572, 0.025407571345567703, 0.0704655572772026, -0.04321803152561188, -0.030834142118692398, 0.017761148512363434, 0...
( figsize = ( 10, 6 ) ) plt. plot ( df ['date'], df ['sp500'], marker ='', linestyle ='- ', color ='b') plt. title ('s & p 500 time series') plt. xlabel ('date') plt. ylabel ('s & p 500 value') plt. grid ( true ) # apply the formatter to the y - axis plt. gca ( ). yaxis. set _ major _ formatter ( funcformatter ( y _ fo...
openstax_principles-of-data-science-web
[ 0.04536506161093712, -0.00017404947720933706, 0.031057270243763924, 0.006984393578022718, -0.0025449194945394993, 0.0035350255202502012, 0.022535769268870354, -0.007956458255648613, 0.041174180805683136, 0.056900911033153534, 0.006027196999639273, -0.02640599198639393, 0.008867940865457058, ...
5. 2 components of time series analysis learning outcomes by the end of this section, you should be able to : β€’ 5. 2. 1 define the trend curve of a time series. β€’ 5. 2. 2 define and identify seasonal and cyclic variations in time series data. β€’ 5. 2. 3 discuss how noise and error affect a time series. time series data ...
openstax_principles-of-data-science-web
[ -0.021261265501379967, 0.05504245311021805, 0.010912568308413029, -0.03383125737309456, 0.026359358802437782, 0.013444111682474613, -0.018723051995038986, -0.0168627742677927, 0.023349568247795105, 0.08719979226589203, 0.0019311109790578485, 0.012057468295097351, -0.013769146054983139, -0....
random error. indeed, you might consider that trend, seasonal, and noise components are three separate time series that all contribute to the time series data. although we still want to think of each component as a sequence of values, it is customary to drop the parentheses in the notation. thus, the time series will b...
openstax_principles-of-data-science-web
[ -0.03472097963094711, 0.033865787088871, 0.0028713434003293514, -0.029398823156952858, 0.011639067903161049, -0.016264241188764572, -0.0146110774949193, -0.009565746411681175, 0.02716175839304924, 0.08632028102874756, 0.013930979184806347, 0.014788703061640263, -0.005936763249337673, -0.06...
, the trend is the direction that the data follows when variations such as seasonal ups and downs and random noise and error are ignored. the trend curve ( or trendline ) models the trend by a line or curve, representing something like a mean value for the time series in any given time frame. by this definition, the li...
openstax_principles-of-data-science-web
[ -0.014925866387784481, 0.021507669240236282, -0.015730319544672966, 0.022331073880195618, 0.015662062913179398, 0.0055047450587153435, 0.013493222184479237, -0.0141117163002491, 0.03524333983659744, 0.10284250229597092, -0.009066572412848473, -0.01524292677640915, 0.0027845525182783604, 0....
/ monthly - coal - energy - consumption - in - the - us / ) although there are numerous ups and downs, there is clearly an overall trajectory of the data. if you were given the task to draw a curve that best captures the underlying trend, you might draw something like the
openstax_principles-of-data-science-web
[ 0.01018774788826704, -0.000984024372883141, -0.011214465834200382, 0.0005901007098145783, -0.014919285662472248, 0.011708267033100128, 0.009818682447075844, -0.0029943769332021475, 0.05496466904878616, 0.07029590755701065, 0.034441106021404266, 0.019498856738209724, 0.008389649912714958, -...
5. 2 β€’ components of time series analysis 225 curve shown in figure 5. 6. ( this is what we refer to as a trendline or trend curve. ) figure 5. 6 monthly consumption of coal for electricity generation in the united states from 2016 to 2022, in 1000s of tons with trend curve shown ( data source : https : / / www. statis...
openstax_principles-of-data-science-web
[ -0.008612765930593014, 0.04887731745839119, 0.011944301426410675, -0.023038875311613083, 0.004632706753909588, 0.014386557042598724, -0.0021591628901660442, -0.02082749828696251, 0.04307091608643532, 0.1065531075000763, 0.0016756159020587802, -0.01715763844549656, -0.005954621825367212, -0...
the temperature every day for a period of multiple years. you will find that temperatures are warmer in the summer months and colder in the winter months. there is a natural and predicatable pattern of rise and fall on a time scale that repeats every year. this is a classic example of seasonal variation with period 1 y...
openstax_principles-of-data-science-web
[ 0.016345132142305374, 0.07680975645780563, 0.011707386933267117, -0.011458280496299267, -0.007064612582325935, 0.028117600828409195, -0.03357888013124466, 0.02868404984474182, 0.001884341356344521, 0.10282234102487564, 0.011085442267358303, -0.032800424844026566, 0.0020202952437102795, -0....
5. 2 β€’ components of time series analysis 227 figure 5. 8 quarterly revenues for kayak and canoe rentals noise and random variation all data is noisy. there are often complex factors that affect data in ways that are difficult or impossible to predict. even if all factors could be accounted for, there will inevitably b...
openstax_principles-of-data-science-web
[ -0.03598294407129288, 0.05610759183764458, 0.009560458362102509, -0.054272718727588654, 0.017342522740364075, -0.01381253357976675, -0.016778908669948578, -0.025814447551965714, 0.00427030585706234, 0.10212898254394531, 0.005798770114779472, -0.012336918152868748, 0.006825973745435476, -0....
to zero anywhere in the series. 228 5 β€’ time series and forecasting access for free at openstax. org 2. constant variance. the variance should be approximately the same anywhere in the series. ( note : variance is defined in measures of variation. ) 3. uncorrelated. the sequence of values at one point in the series sho...
openstax_principles-of-data-science-web
[ 0.021273810416460037, 0.06280269473791122, 0.008799063041806221, -0.01670951582491398, -0.0003248432476539165, -0.039930541068315506, 0.006924998946487904, -0.015569016337394714, -0.0007118522771634161, 0.08920776098966599, 0.014535981230437756, 0.0002642243925947696, 0.002259900327771902, ...
5. 3 time series forecasting methods learning outcomes by the end of this section, you should be able to : β€’ 5. 3. 1 analyze a time series by decomposing it into its components, including trend, seasonal and cyclic variation, and residual noise. β€’ 5. 3. 2 compute various kinds of moving averages, weighted moving averag...
openstax_principles-of-data-science-web
[ -0.015091471374034882, 0.0400744192302227, -0.03248695656657219, -0.034269239753484726, -0.00019391010573599488, 0.005430659279227257, -0.04812238737940788, 0.004153667949140072, 0.01173154916614294, 0.11674148589372635, 0.007244396023452282, -0.0010611655889078975, -0.009129203855991364, ...
5. 3 β€’ time series forecasting methods 229 series as a whole through one of two complementary operations : isolating the trend and then removing it or smoothing out the trend leaving only the seasonal and error components. methods that reduce the error term and flatten out seasonal variations result in a trend - cycle ...
openstax_principles-of-data-science-web
[ -0.03618820756673813, 0.07521098852157593, -0.020261062309145927, -0.019265560433268547, 0.007496075704693794, -0.0009203883819282055, -0.027501484379172325, -0.0181072149425745, 0.011452187784016132, 0.09582037478685379, 0.008910944685339928, 0.003630618331953883, -0.009110396727919579, -...
. the ( first - order ) difference of a time series is found by differencing, or taking differences of consecutive terms β€” that is, the nth term of the difference would be. if the original time series had a linear trend, then the difference would display a relatively constant trend with only noise and seasonal variatio...
openstax_principles-of-data-science-web
[ -0.017393192276358604, 0.08056909590959549, 0.0011739199981093407, -0.014052986167371273, -0.026454351842403412, -0.0023180802818387747, -0.0382523275911808, 0.0006636959151364863, 0.013240017928183079, 0.11984927207231522, 0.0003465798799879849, 0.029885368421673775, 0.00006014785685692914,...
follows, assume that the size of the window is a constant,. given a time series with values, that is, a sequence, the simple moving average with window size is defined as a new series with values given by the formula 230 5 β€’ time series and forecasting access for free at openstax. org this formula is not as difficult a...
openstax_principles-of-data-science-web
[ 0.01003227848559618, 0.06112668290734291, 0.020747549831867218, 0.024128207936882973, -0.007115175947546959, 0.0026306924410164356, -0.007185738533735275, -0.008477789349853992, -0.0014555054949596524, 0.08768884837627411, 0.03986622393131256, 0.02510817162692547, -0.013895583339035511, -0...
size 3 for the data from table 5. 1 and compare with the original line graph. solution the sma will begin at index.
openstax_principles-of-data-science-web
[ 0.005350052844733, 0.022175224497914314, 0.07476942986249924, 0.010055061429738998, -0.012258170172572136, -0.013032342307269573, 0.004682305734604597, -0.00964599009603262, 0.004939135164022446, 0.0872524157166481, 0.022985396906733513, 0.03128119558095932, -0.01224020216614008, -0.048188...
5. 3 β€’ time series forecasting methods 231 the sma is graphed together with the original time series in figure 5. 10. figure 5. 10 line chart of the s & p 500 index together with the simple moving average of length 3 ( data source : adapted from s & p 500 [ spx ] historical data ) simple moving averages provide an easy...
openstax_principles-of-data-science-web
[ -0.003911592997610569, 0.06936671584844589, -0.0009015912073664367, 0.002090253634378314, 0.0007203755085356534, -0.0009958533337339759, -0.015756549313664436, -0.014965706504881382, 0.005416670348495245, 0.1121244877576828, 0.035109467804431915, 0.013902252539992332, -0.022369353100657463, ...
, the first - order difference of a sequence is another sequence, denoted, consisting of the differences of consecutive terms. that is, note that there is one fewer term in the difference compared to the original time series. differencing has the effect of leveling out a uniform upward or downward trend without affecti...
openstax_principles-of-data-science-web
[ -0.027036305516958237, 0.05889623612165451, 0.0213774386793375, 0.004294178914278746, -0.01403052918612957, -0.012390805408358574, -0.038130082190036774, -0.006513600237667561, 0.00022380152950063348, 0.10640551894903183, -0.003474409459158778, 0.03074776940047741, -0.005375186447054148, -...
4769. 83 table 5. 3 first - order difference time series for the data in table 5. 1 ( source : adapted from https : / / www. nasdaq. com / market - activity / index / spx / historical ) figure 5. 11 shows the graph of the original data together with its difference series. figure 5. 11 comparison of s & p index values a...
openstax_principles-of-data-science-web
[ -0.017449717968702316, 0.0660315603017807, 0.04096313565969467, 0.012828396633267403, -0.0021497749257832766, 0.010121078230440617, -0.02410312369465828, -0.0021775232162326574, 0.034351617097854614, 0.10055823624134064, 0.03260384127497673, 0.041696224361658096, -0.014268383383750916, -0....
every term is equal to 0. this important result can be proved mathematically, but we will not present the proof in this text. as an example, consider the sequence, which has order 1, since you can find the values using the formula. the difference sequence is, which is a constant sequence, so it has order 0. notice that...
openstax_principles-of-data-science-web
[ -0.01043833326548338, 0.047003373503685, 0.035884350538253784, -0.009662775322794914, -0.006683077197521925, -0.028158891946077347, -0.016009299084544182, 0.0048497929237782955, -0.0319422110915184, 0.13298210501670837, 0.03272389620542526, 0.038003452122211456, -0.0016597170615568757, -0....
is exactly linear, quadratic, or any given degree. every time series will have some noise in addition to possible seasonal patterns. however, the trend - cycle curve may still be well approximated by a polynomial model of some order. sma and differencing in excel excel can easily do simple moving averages and differenc...
openstax_principles-of-data-science-web
[ -0.021765252575278282, 0.06180359795689583, 0.013229884207248688, -0.0114149684086442, 0.007214521523565054, 0.008375396952033043, -0.00004342866304796189, -0.02785087563097477, 0.019745217636227608, 0.12042868882417679, 0.0354141891002655, 0.030069584026932716, -0.01528534572571516, -0.06...
5. 3 β€’ time series forecasting methods 235 first, you will need to save the file as an excel worksheet, as csv files do not support equations. let ’ s include a centered 13 - term window sma ( see figure 5. 12 ). in cell c8, type β€œ = average ( b2 : b14 ) ” as shown in figure 5. 12. note : there should be exactly 6 rows...
openstax_principles-of-data-science-web
[ 0.004103511571884155, 0.0419679619371891, 0.01679215207695961, -0.0027026485186070204, 0.006409605965018272, 0.019303705543279648, -0.007490720134228468, -0.017420420423150063, 0.038496315479278564, 0.059910450130701065, 0.016602516174316406, 0.018694035708904266, -0.0009613660513423383, -...
5. 3 β€’ time series forecasting methods 237 let ’ s now work out the first - order difference. the idea is very similar. put the formula for the difference, which is nothing more than β€œ = b3 - b2, ” into cell d3, as in figure 5. 15. figure 5. 15 screenshot of excel showing formula for difference in column d ( used with ...
openstax_principles-of-data-science-web
[ -0.004585832357406616, 0.030067777261137962, -0.018513435497879982, -0.008712446317076683, -0.0011541439453139901, -0.002974173752591014, 0.006450412329286337, -0.02382139302790165, 0.009322727099061012, 0.10376261919736862, 0.012053861282765865, 0.02850128710269928, 0.01736229471862316, -...
##formatter # for graph formatting and y - axis formatting import matplotlib. dates as mdates # for date formatting # read the excel file into a pandas dataframe df = pd. read _ excel ('monthlycoalconsumption. xlsx') # convert'month'column to datetime format df ['month'] = pd. to _ datetime ( df ['month'], format ='% m...
openstax_principles-of-data-science-web
[ 0.00446538208052516, 0.01715231128036976, 0.006339676212519407, -0.014103335328400135, -0.005799761041998863, -0.0038295851554721594, 0.0027982345782220364, -0.012247509323060513, 0.02757961116731167, 0.09379856288433075, -0.04207245633006096, -0.0008515211520716548, 0.022883307188749313, ...
first date and end at the maximum date in the data plt. xlim ( pd. to _ datetime ('01 / 01 / 2016 ', format ='% m / % d / % y'), df ['month']. max ( ) ) # format the x - axis to show dates as mm / dd / yyyy and set the locator for a fixed number of ticks ax = plt. gca ( ) python code
openstax_principles-of-data-science-web
[ 0.025750108063220978, 0.008358685299754143, 0.025957699865102768, 0.005739412270486355, -0.04192066192626953, -0.03273863345384598, 0.009917267598211765, -0.010053426027297974, 0.04309023171663284, 0.05143629387021065, -0.024526862427592278, -0.005036934744566679, 0.003512157592922449, -0....
5. 3 β€’ time series forecasting methods 239 ax. xaxis. set _ major _ formatter ( mdates. dateformatter ('% m / % d / % y') ) ax. xaxis. set _ major _ locator ( maxnlocator ( nbins = 12 ) ) # set the number of ticks to a reasonable value # manually set the rotation of date labels to 45 degrees plt. xticks ( rotation = 45...
openstax_principles-of-data-science-web
[ -0.017973948270082474, 0.025487614795565605, 0.0016493494622409344, -0.031102478504180908, 0.0027725808322429657, -0.00988087523728609, -0.025394381955266, -0.01635478250682354, 0.013444767333567142, 0.09789212793111801, -0.009083268232643604, -0.014543063007295132, 0.0014641010202467442, ...
same pattern repeats after 64 time steps, and so the period is 64. while it is easy to spot the repeating pattern in a time series that does not have noise, the same cannot be said for the general case. there are several tools available for isolating the seasonal component of a detrended time series. identifying the pe...
openstax_principles-of-data-science-web
[ 0.003772373776882887, 0.06693762540817261, 0.010836124420166016, 0.003072830382734537, -0.0008323813090100884, -0.0036446002777665854, -0.03419063985347748, -0.01325209066271782, 0.02225746400654316, 0.11266098916530609, 0.036567844450473785, -0.015325878746807575, -0.0044211470521986485, ...
##f shows relatively large correlation at lags of 1, 2, 3, etc., there may not be a true seasonal component present. the positive lag corresponding to the first significant peak, or autocorrelation value that is much larger than the previous values, may indicate a seasonal component with that period. later, we will see...
openstax_principles-of-data-science-web
[ 0.012290365993976593, 0.045584388077259064, -0.014299934729933739, 0.02072654664516449, -0.001978475134819746, -0.0008439811645075679, -0.018455971032381058, -0.007524556014686823, 0.040513936430215836, 0.07573194056749344, 0.025303252041339874, -0.013083954341709614, 0.014062420465052128, ...
5. 3 β€’ time series forecasting methods 241 moreover, suppose that the period of is. of course, with the noise term still present in the time series, we cannot expect that holds, but it should be the case that for every. in other words, the data should look approximately the same when shifted by time steps. our job now ...
openstax_principles-of-data-science-web
[ -0.006634799297899008, 0.06398314982652664, -0.008393052965402603, -0.012813389301300049, 0.003955499269068241, -0.004738526418805122, -0.01899564266204834, 0.00792811531573534, 0.004033129196614027, 0.08494168519973755, 0.031119098886847496, -0.025083517655730247, -0.003535797353833914, -...
is closely related to the underlying trend - cycle curve,, though generally it contains the noise and other random factors that does not generally include. example 5. 6 problem the revenue data from walt ’ s water adventures ( see table 5. 2 ) seems to display seasonality of period 4. using the level as the trend, detr...
openstax_principles-of-data-science-web
[ -0.0132595831528306, 0.06358347088098526, 0.006019336171448231, -0.03792783245444298, -0.008595260791480541, -0.0026670934166759253, -0.03159965202212334, 0.012661400251090527, -0.0015720902010798454, 0.12029354274272919, 0.0008770556887611747, -0.022300781682133675, -0.007920774631202221, ...
##1. 42 βˆ’764. 75 2358. 75 9 2023 spring 2704 428. 58 βˆ’13. 08 2717. 08 10 2023 summer 3849 1573. 58 1261. 92 2587. 08 11 2023 fall 2131 βˆ’144. 42 βˆ’484. 08 2615. 08 12 2023 winter 1939 βˆ’336. 42 βˆ’764. 75 2703. 75 table 5. 4 quarterly revenues for kayak and canoe rentals ( all columns in $ ). columns for detrended data, sea...
openstax_principles-of-data-science-web
[ 0.004019015468657017, 0.023156683892011642, -0.0002574824611656368, 0.010493138805031776, -0.026424497365951538, 0.01649918407201767, -0.00030399693059735, 0.044561684131622314, 0.013382893055677414, 0.06477238237857819, 0.02485516481101513, 0.01293772179633379, -0.019408486783504486, -0.0...
5. 3 β€’ time series forecasting methods 243 figure 5. 18 quarterly revenues for kayak and canoe rentals. seasonal component and seasonally adjusted time series are included on the graph. decomposing a time series into components using python there is a powerful python library known as statsmodels ( https : / / openstax....
openstax_principles-of-data-science-web
[ -0.007034209091216326, 0.03922522813081741, -0.014483450911939144, -0.010331911034882069, 0.011752050369977951, 0.004219366703182459, -0.027218999341130257, 0.00738330977037549, 0.0282475296407938, 0.08939526975154877, 0.009984125383198261, -0.003822668455541134, -0.013275740668177605, -0....
data. we will use period 12 in our stl decomposition. # import libraries from statsmodels. tsa. seasonal import stl import matplotlib. pyplot as plt # # for data visualization # perform seasonal decomposition using stl stl = stl ( df ['value'], period = 12 ) result = stl. fit ( ) # plot components and format the y - ax...
openstax_principles-of-data-science-web
[ 0.003156342078000307, -0.0004913854645565152, 0.020794864743947983, -0.03572365641593933, -0.0157152209430933, -0.012225423008203506, -0.0206831656396389, 0.0027189638931304216, 0.019945403560996056, 0.06995128095149994, -0.025661583989858627, -0.0014256694121286273, -0.0037761765997856855, ...
5. 3 β€’ time series forecasting methods 245 the resulting output will look like this : the trend, seasonal variation, and residual ( noise ) components are all graphed in separate plots. to see them all on the same set of axes, we can use matplotlib ( noise omitted ). import matplotlib. pyplot as plt # # for data visual...
openstax_principles-of-data-science-web
[ -0.02577962912619114, 0.03043205663561821, -0.02620401419699192, -0.034203048795461655, 0.00925620086491108, -0.010869295336306095, -0.011160782538354397, -0.032451145350933075, 0.019175101071596146, 0.08485804498195648, -0.011440731585025787, -0.0037049984093755484, 0.005210589151829481, ...
model, with a window of terms : this model may be regarded as a weighted moving average model ( wma ) in which the weights of the most recent terms are all equal to, while all other weights are set to 0. for example, in an sma model with, the weights would be even the naive model,, counts as a wma, with weights 1, 0, 0...
openstax_principles-of-data-science-web
[ 0.010897093452513218, 0.04472815990447998, -0.023683764040470123, 0.021692441776394844, 0.009134392254054546, 0.005986024625599384, 0.020366305485367775, 0.003411036916077137, -0.027291391044855118, 0.06964418292045593, 0.022415298968553543, 0.027451351284980774, -0.024095483124256134, -0....
5. 3 β€’ time series forecasting methods 247 of course, if we want the model to do a good job in forecasting new values of the time series, then the coefficients must be chosen wisely. typically, the weights must be normalized, which means that they sum to 1. however, there is no hard - and - fast requirement that the su...
openstax_principles-of-data-science-web
[ 0.012213114649057388, 0.04900715872645378, 0.004802714101970196, -0.009036962874233723, 0.00101259455550462, 0.018692174926400185, 0.0027256838511675596, -0.012027891352772713, -0.02715909294784069, 0.046704042702913284, 0.04255557060241699, 0.0076273404993116856, 0.004508195444941521, -0....