<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help translating Python statsmodel.api.OLS.summary() into Qlik in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-translating-Python-statsmodel-api-OLS-summary-into-Qlik/m-p/1684651#M455809</link>
    <description>&lt;P&gt;Answered a few of these items with further research on Python &amp;amp; statistics &lt;EM&gt;(though it did take wading through several articles just to get the answer, which turned out to be really simple, but you'd be surprised how many discussions on the topic did not explain it in a clear way).&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The t-stats are the coefficient / standard error.&amp;nbsp; I don't know how I didn't see this in original looks, but you just divide the first column in the Summary() table by the second column, and viola.. "t-stat".&lt;BR /&gt;&lt;BR /&gt;In this case for the Qlik sytax that meant:&lt;BR /&gt;Linest_M / Linest_SEM&amp;nbsp; for the first field &lt;EM&gt;(x)&lt;/EM&gt;, and Linest_B / Linest_SEB for the second field &lt;EM&gt;(y).&amp;nbsp; Keep the&amp;nbsp; '_M' &amp;amp; '_SEM' paired together and the '_B', '_SEB' together.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;Then to get the 'P &amp;gt; |t|' p-value, you plug in the results of the t-stat as first argument in the TDIST() function.&lt;BR /&gt;&lt;BR /&gt;Which uses TDIST(score, degrees freedom, # tails) or TDIST( Linest_M/Linest_SEM, Linest_DF, 2)&amp;nbsp; &lt;EM&gt;(*note you can do the same for _B functions but not sure the results have the same ".05 or below represents significance" rule) &amp;nbsp;&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;continuing work on getting those probability ranges to line up.&amp;nbsp; I see Qlik producing ranges with the TTest upper&amp;amp;lower functions, but not quite lining up with the Python yet.&lt;BR /&gt;&lt;BR /&gt;I thought it was cool though that I could select multiple data samples and pull up their regression profiles pretty easily.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;the next challenge is also building this out as a multi-factor regression &lt;EM&gt;(which I hope is possible to do in Qlik). &amp;nbsp; Thanks for your assistance, all.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python_to_Qlik_translation_Regression_Least_Squares.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/30040i988AF2991F006C9D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python_to_Qlik_translation_Regression_Least_Squares.png" alt="Python_to_Qlik_translation_Regression_Least_Squares.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 14 Mar 2020 19:54:35 GMT</pubDate>
    <dc:creator>evan_kurowski</dc:creator>
    <dc:date>2020-03-14T19:54:35Z</dc:date>
    <item>
      <title>Help translating Python statsmodel.api.OLS.summary() into Qlik</title>
      <link>https://community.qlik.com/t5/QlikView/Help-translating-Python-statsmodel-api-OLS-summary-into-Qlik/m-p/1683989#M455808</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hello Qlik Community,&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;First off let me point out that Data Science is just obnoxious.&amp;nbsp; I mean.. geez, there's so many calculations my head is swimming and just not getting what all these fancy math hieroglyphics are gonna be useful for..&amp;nbsp; this better have a big payoff.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;(hope you guys don't mind the candor, maybe one day I'll look back on this and be like "Oh man, can't believe I wasn't infatuated with data science sooner", it's so awesome! &amp;nbsp; But for now, not seeing the point , while meanwhile data science is stealing a lot of thunder when we coulda been crankin out plenty of the plain ole "regular" analytics)&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;BUT..&lt;/STRONG&gt; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I'm still dutifully trying to wrap my head around this stuff &lt;EM&gt;(even though on 1-to-1 basis I would take killer data mungers on my team over polymaths.&amp;nbsp; I control zero staffers, so ... this point is moot).&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Maybe they're making actual rockets with this stuff at other companies?&amp;nbsp;&lt;EM&gt; (But where I'm at we still often don't even arrive at consensus on Count(*) , so&amp;nbsp;this seems like a real overreach in terms of technical ambition)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;&lt;EM&gt;ANYWAY..&lt;/EM&gt; So my problem is this...&amp;nbsp;&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;My data science course has taught us how to absorb a pair of X,Y values and build a linear regression.&lt;/FONT&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;FONT size="3"&gt;It uses the &lt;STRONG&gt;statsmodels.api&lt;/STRONG&gt; package in Python to achieve this:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;&lt;FONT face="courier new,courier" size="3"&gt;import statsmodels.api as sm &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;y_qlik = data_Qlik['Comparison']&amp;nbsp; # y = b0 + b1x1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;x_qlik1 = data_Qlik['Observation']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;x_qlik = sm.add_constant(x_qlik1)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;results = sm.OLS(y_qlik,x_qlik).fit()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;results.summary()&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;In order to do an A - B comparison between technologies, I used the sample data set in the Qlik help manual through both Python &amp;amp; Qlik, that data set is found here: &lt;/FONT&gt;&lt;FONT size="5"&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/ChartFunctions/StatisticalTestFunctions/ttest/ttest_t_example.htm" target="_self"&gt;Qlik ttest sample data set&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;[Table1]:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;crosstable LOAD recno() as ID, * inline [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Observation|Comparison&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;35|2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;40|27&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;12|38&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;15|31&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;21|1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;14|19&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;46|1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;10|34&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;28|3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;48|1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;16|2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30|3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;32|2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;48|1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;31|2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;22|1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;12|3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;39|29&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;19|37&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;25|2 ] (delimiter is '|')&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The Python &lt;STRONG&gt;statsmodel.api.OLS.Summary()&lt;/STRONG&gt; puts out a neat table full of impressive math-babble.&amp;nbsp; I'm trying to follow along the narration of the data science course and recreate the functions in Qlik.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Parallel_evaluations_between_Python_and_Qlik_incomplete.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/29915i683F3AAAC46B6182/image-size/large?v=v2&amp;amp;px=999" role="button" title="Parallel_evaluations_between_Python_and_Qlik_incomplete.png" alt="Parallel_evaluations_between_Python_and_Qlik_incomplete.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can connect 8 pieces of calculation between the Python approach &amp;amp; Qlik.&amp;nbsp; My problem is I've gotten stuck on the 't' &amp;amp; 'P&amp;gt;|t|' section.&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;&lt;FONT size="3"&gt;The Python course describes these numbers as &lt;EM&gt;'t-statistic'&lt;/EM&gt; and&lt;EM&gt; 'p value'&lt;/EM&gt;, with a hypothesis value of 0.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can anyone help me understand what Python uses to produce this section of number?&amp;nbsp; &lt;/FONT&gt;&lt;FONT size="3"&gt;I've tried several &lt;EM&gt;"t something or other formulas"&lt;/EM&gt; and nothing seems to nail it.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;**sidenote to administrators of Qlik Community**&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Yet again the post editing process was HORRENDOUS.&amp;nbsp; And it has been this way ever since we migrated the community site.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;I imagine from Qlik's perspective, when testing the community portal everything appears to be working fine. &lt;EM&gt;(otherwise there would be no release of buggy code, right?)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;But from end-user perspective, the formatting, the cut &amp;amp; paste, the rendering is just absolutely terrible and it takes many incompleted attempts and retries to format an article. &amp;nbsp; no exaggeration when I say attempts to cut &amp;amp; paste paragraphs into the 'Body' pane worked maybe 3 out of every 10 attempts?&amp;nbsp; I had to chop the article up a sentence at a time and each time I pasted a sentence, the font formatting made it the wrong size.&amp;nbsp; Like this portal is trying to exhaust my patience. &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;If this is the same experience the full population of end-users is experiencing, you should really look into this, it's not a good look&amp;nbsp; and I'm sure it would discourage visits.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;I'm open to the idea there's some kind of &lt;EM&gt;"bug-in-the-middle"&lt;/EM&gt; attack specific to browser functionailty at my company &lt;EM&gt;(or just specific to me, and if so does anyone know any good lawyers?),&lt;/EM&gt; but would really suggest you ensure the quality of experience for the overall community isn't just a Qlik facing facade giving out false-positives.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;&lt;EM&gt;**p.p.s to Community administrators**&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;I was at work and hit the 'Post' button trying to submit this post, and a red-error appeared that said &lt;EM&gt;"Invalid HTML characters"&lt;/EM&gt; .&amp;nbsp; I tried to make the correction and figure out what characters were invalid, but the Body pane was empty and frozen.&amp;nbsp; Hitting the PREVIEW button flashed the HTML for just a split second, and no matter what I tried, I could not recover my post.&lt;BR /&gt;&lt;BR /&gt;Since these &lt;EM&gt;"aborted"&lt;/EM&gt; postings happen often, I now prepare postings in an external editor before attempting the risky transfer into the community portal.&amp;nbsp; I emailed the body of the post to my personal email and completed this from a browser at home.&amp;nbsp; Editing features seemed to work better at home and also the auto-post recovery had preserved my earlier post, but none of this was functional when I attempted it from work.&lt;BR /&gt;&lt;BR /&gt;I had my own website once, and when I worked on development from home, the website previews worked fine.&amp;nbsp; Weirdly, when I would go out in public and ask people to visit my website, from their phones or computers at other places, almost every time an attempt to load the &lt;EM&gt;"publ&lt;/EM&gt;&lt;I&gt;ic"&lt;/I&gt; website would fail.&amp;nbsp; Maybe there's something like that going on here?&amp;nbsp; &lt;EM&gt;If a website fails to load in the woods, does it make a sound?&lt;/EM&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;You can see I started the post cheerful, but after such a struggle, humor is wearing thin.&amp;nbsp; &lt;/FONT&gt;&lt;FONT size="5"&gt;&lt;FONT size="2"&gt;It took me a decent amount of time to formulate, and hope the participation is appreciated as much as I appreciate the solutions.&amp;nbsp; This feedback is to help as I am definitely a Qlik proponent. &amp;nbsp; Thank you community.&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:57:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-translating-Python-statsmodel-api-OLS-summary-into-Qlik/m-p/1683989#M455808</guid>
      <dc:creator>evan_kurowski</dc:creator>
      <dc:date>2024-11-16T18:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help translating Python statsmodel.api.OLS.summary() into Qlik</title>
      <link>https://community.qlik.com/t5/QlikView/Help-translating-Python-statsmodel-api-OLS-summary-into-Qlik/m-p/1684651#M455809</link>
      <description>&lt;P&gt;Answered a few of these items with further research on Python &amp;amp; statistics &lt;EM&gt;(though it did take wading through several articles just to get the answer, which turned out to be really simple, but you'd be surprised how many discussions on the topic did not explain it in a clear way).&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The t-stats are the coefficient / standard error.&amp;nbsp; I don't know how I didn't see this in original looks, but you just divide the first column in the Summary() table by the second column, and viola.. "t-stat".&lt;BR /&gt;&lt;BR /&gt;In this case for the Qlik sytax that meant:&lt;BR /&gt;Linest_M / Linest_SEM&amp;nbsp; for the first field &lt;EM&gt;(x)&lt;/EM&gt;, and Linest_B / Linest_SEB for the second field &lt;EM&gt;(y).&amp;nbsp; Keep the&amp;nbsp; '_M' &amp;amp; '_SEM' paired together and the '_B', '_SEB' together.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;Then to get the 'P &amp;gt; |t|' p-value, you plug in the results of the t-stat as first argument in the TDIST() function.&lt;BR /&gt;&lt;BR /&gt;Which uses TDIST(score, degrees freedom, # tails) or TDIST( Linest_M/Linest_SEM, Linest_DF, 2)&amp;nbsp; &lt;EM&gt;(*note you can do the same for _B functions but not sure the results have the same ".05 or below represents significance" rule) &amp;nbsp;&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;continuing work on getting those probability ranges to line up.&amp;nbsp; I see Qlik producing ranges with the TTest upper&amp;amp;lower functions, but not quite lining up with the Python yet.&lt;BR /&gt;&lt;BR /&gt;I thought it was cool though that I could select multiple data samples and pull up their regression profiles pretty easily.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;the next challenge is also building this out as a multi-factor regression &lt;EM&gt;(which I hope is possible to do in Qlik). &amp;nbsp; Thanks for your assistance, all.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python_to_Qlik_translation_Regression_Least_Squares.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/30040i988AF2991F006C9D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python_to_Qlik_translation_Regression_Least_Squares.png" alt="Python_to_Qlik_translation_Regression_Least_Squares.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Mar 2020 19:54:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-translating-Python-statsmodel-api-OLS-summary-into-Qlik/m-p/1684651#M455809</guid>
      <dc:creator>evan_kurowski</dc:creator>
      <dc:date>2020-03-14T19:54:35Z</dc:date>
    </item>
  </channel>
</rss>

