<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rahardito Dio Prastowo on Medium]]></title>
        <description><![CDATA[Stories by Rahardito Dio Prastowo on Medium]]></description>
        <link>https://medium.com/@RaharditoDP?source=rss-d632da2f7d6d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aUk7wJRt7n9SsJClsP2dOA.jpeg</url>
            <title>Stories by Rahardito Dio Prastowo on Medium</title>
            <link>https://medium.com/@RaharditoDP?source=rss-d632da2f7d6d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 01:15:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@RaharditoDP/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cara Baru Membaca Ekosistem Industri: Analisis Jaringan Berbasis Link di Sektor Logistik]]></title>
            <link>https://medium.com/@RaharditoDP/cara-baru-membaca-ekosistem-industri-analisis-jaringan-berbasis-link-di-industri-logistik-korea-944d924ea89c?source=rss-d632da2f7d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/944d924ea89c</guid>
            <category><![CDATA[social-network]]></category>
            <category><![CDATA[network-analysis]]></category>
            <dc:creator><![CDATA[Rahardito Dio Prastowo]]></dc:creator>
            <pubDate>Sat, 22 Nov 2025 03:16:23 GMT</pubDate>
            <atom:updated>2025-11-22T03:17:26.430Z</atom:updated>
            <content:encoded><![CDATA[<p>Bagaimana seharusnya kita membaca peta hubungan antar industri, khususnya di era transportasi dan logistik digital yang hiper-kompleks? Sudah banyak studi yang mulai beralih dari analisis node-centric (berbasis simpul) ke link-centric (berbasis hubungan/link) untuk lebih memahami aliran sumber daya dan peran laten dalam ekosistem industri.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*cc55kUdE7AxinWyyujLsZQ.jpeg" /><figcaption><a href="https://www.armstrongglobalinstitute.com/">https://www.armstrongglobalinstitute.com/</a></figcaption></figure><h3>Node-Centric: Apa yang Kurang?</h3><p>Biasanya, analisis jejaring dalam ekonomi industri mengandalkan node centrality — seperti degree, betweenness, dan closeness centrality — untuk menunjukkan “aktor utama” di jaringan. Tapi, ini sering melupakan jalur strategis yang dilalui barang, jasa, dan informasi di antara node-node tersebut. Node yang tampak kecil lewat pendekatan klasik bisa jadi “jalan tol” penting bagi jaringan secara keseluruhan.</p><h3>Apa yang Ditawarkan Pendekatan Link-Centric?</h3><p>Model yang dibangun dengan memamfaatkan data industri logistik seperti data input-output (IO) dapat digunakan untuk memetakan industri sebagai jaringan berbobot interaksi dagang. Tidak hanya melihat seberapa tersambung suatu industri (node), tapi telusuri juga jalur link dan ukur “jaraknya” berdasarkan volume transaksi — semakin besar volume, semakin pendek jaraknya.</p><p>Dengan menerapkan Network Analysis, jalur terpenting dalam sistem logistik nasional seringkali menghubungkan industri yang selama ini dianggap “biasa saja”, misal industri peralatan listrik atau telekomunikasi, ke jantung transportasi darat, laut, dan udara.</p><h3>Klasifikasi Baru: Primary, Secondary, Tertiary</h3><p>Lewat analisis klaster seperti penerapan metode K-Means terhadap jalur-jalur terpendek, analisis dapat dilakukan untuk membagi industri terkait logistik yang pada alkhirnya akan menjadi industri-industri tersebut menjadi beberapa grup, contohnya:</p><ul><li>Primary: Industri sumber daya (misal: batu bara, minyak bumi) dengan hubungan langsung dan erat.</li><li>Secondary: Pemasok barang dan jasa menengah (misal: manufaktur, energi, telekomunikasi).</li><li>Tertiary: Industri pendukung tidak langsung (misal: IT, layanan keuangan, R&amp;D) yang menjadi tulang punggung inovasi dan digitalisasi ekosistem logistik.</li></ul><h3>Contoh Potensi Insight: Peran Tersembunyi Industri Teknologi</h3><p>Salah satu insight yang bisa muncul dari pendekatan link-centric adalah bahwa industri teknologi ternyata punya peran besar yang sebelumnya tidak terlihat.<br> Walaupun nilai transaksinya tidak sebesar sektor lain, informasi &amp; komunikasi justru sering menjadi penghubung penting dalam aliran logistik — semacam “jalan pintas” yang menyambungkan banyak sektor.</p><p>Artinya, untuk membuat sistem logistik lebih efisien dan tangguh, tidak cukup hanya memperkuat transportasinya saja. Infrastruktur digital dan layanan teknologi juga harus diperkuat, karena merekalah yang menjaga koordinasi, data, dan komunikasi tetap berjalan lancar.</p><p><strong>Penutup: Kenapa Network Analysis Akan Semakin Penting Dibahas</strong></p><p>Pendekatan link-centric memberi kita cara baru untuk membaca ekosistem industri — bukan hanya siapa yang besar, tapi <em>siapa yang benar-benar menghubungkan semuanya</em>. Di era logistik digital yang makin kompleks, jalur hubungan antarsektor sama pentingnya dengan para pemain utamanya. Dan justru dari jalur-jalur itulah insight paling mengejutkan sering muncul: peran tersembunyi, penghubung senyap, dan industri kecil yang ternyata memegang kunci efisiensi sistem.</p><p>Karena itulah ke depan, saya akan semakin sering membahas bagaimana <em>network analysis</em> membuka perspektif baru dalam memahami ekonomi, logistik, hingga kebijakan industri. Bukan hanya teori, tapi juga contoh kasus, eksperimen data, dan insight praktis dari berbagai sektor.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=944d924ea89c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crafting Connections in the Digital Age: Exploring the Power of Creative Writing in Social Commerce]]></title>
            <link>https://medium.com/@RaharditoDP/crafting-connections-in-the-digital-age-exploring-the-power-of-creative-writing-in-social-commerce-c1760c138293?source=rss-d632da2f7d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1760c138293</guid>
            <dc:creator><![CDATA[Rahardito Dio Prastowo]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 08:04:23 GMT</pubDate>
            <atom:updated>2024-12-20T08:04:23.877Z</atom:updated>
            <content:encoded><![CDATA[<p>As a researcher delving into the evolving field of social commerce, I’ve become increasingly fascinated by the interplay between technology, communication, and consumer behavior. One of the most intriguing aspects of this dynamic landscape is the role of digital writing in shaping trends and driving engagement. From crafting persuasive product descriptions to creating viral social media campaigns, digital writing serves as the backbone of modern online interactions, bridging the gap between brands and their audiences. It’s not just a tool for communication; it’s a powerful medium that influences perceptions, builds trust, and ultimately drives commerce in today’s digital age.</p><p>Digital writing encompasses a wide range of styles and formats, each tailored to specific audiences and platforms. From concise and engaging social media posts to in-depth blog articles, email campaigns, and digital advertisements, the essence of digital writing lies in its ability to communicate effectively in a digital-first world. At its core, digital writing is not just about words — it’s about crafting experiences that resonate with audiences.</p><p>Among its many forms, digital copywriting stands out as a creative tool to deliver impactful messages in the shortest time possible. It thrives on brevity, wit, and an innate understanding of cultural references. Another crucial type is storytelling-based writing, often used in blogs or content marketing, where narratives are built to inform, entertain, and build connections. Then there’s UX writing, which focuses on clarity and functionality, shaping user experiences through microcopy such as buttons, tooltips, and error messages.</p><p>As I explored creative examples of digital writing, I stumbled upon something truly unique: a series of advertisements for Spotify Premium. These ads brilliantly highlight the potential of digital writing to captivate audiences and deliver a clear message. At first glance, the ads seem like playful juxtapositions of unrelated ideas, but a closer look reveals their genius.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*jiGVRYz_edrFeIMsmy122A.png" /></figure><p>Spotify’s campaign merges famous musicians’ names with well-known brands to create humorous and unexpected combinations. For instance:</p><ul><li><em>Radiohead &amp; Shoulders</em>: Fusing the alternative rock band <em>Radiohead</em> with the shampoo brand <em>Head &amp; Shoulders</em>, this combination exudes creativity and humor.</li><li><em>Celine Dior</em>: A clever blend of <em>Celine Dion</em> and the luxury brand <em>Dior</em>, this mashup captures attention instantly by its playful familiarity.</li><li><em>Kanye Western Union</em>: A play on <em>Kanye West</em> and <em>Western Union</em>, sparking a laugh while retaining its cultural relevance.</li></ul><p>These ads aren’t just about being witty — they have a clear purpose. The tagline, <em>“Skip the ads. Go Premium,”</em> ties the humor to the product, emphasizing the value of Spotify Premium in eliminating interruptions. The brilliance lies in how the ads entertain while staying true to the brand’s message.</p><p>This campaign exemplifies how digital writing, especially in advertising, can be much more than functional — it can be an art form. It uses humor, cultural references, and wordplay to make the audience feel connected and entertained. It also highlights the power of context, as each combination resonates differently depending on the viewer’s familiarity with the references.</p><p>In the end, these ads are a reminder that great digital writing isn’t just about what you write — it’s about how you make people feel. And when executed well, as Spotify’s campaign shows, it can turn even the simplest message into something unforgettable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1760c138293" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using STAR for Experimental Design Analysis in Agricultural and Non-Agricultural Research]]></title>
            <link>https://medium.com/@RaharditoDP/experimental-design-using-star-12021e960de2?source=rss-d632da2f7d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/12021e960de2</guid>
            <category><![CDATA[ux-research]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Rahardito Dio Prastowo]]></dc:creator>
            <pubDate>Tue, 25 Oct 2022 07:34:50 GMT</pubDate>
            <atom:updated>2024-12-20T09:50:16.342Z</atom:updated>
            <content:encoded><![CDATA[<p>Experiments are used to study causal relationships between independent variables and dependent variables. By manipulating one or more independent variables and measuring their effect on the dependent variables, we can test hypotheses about these relationships. Experimental design refers to the method for collecting data and testing these hypotheses.</p><p>Statistical Tool for Agricultural Research (STAR) is a computer program developed by the International Rice Research Institute (IRRI) for data management and basic statistical analysis of experimental data. While initially developed for agricultural purposes, STAR can also be used for business or government purposes. This makes it a valuable tool for data analysts, UX researchers, business analysts, government researchers, or anyone in an analytics role.</p><p>Specifically, experimental design with STAR is closely related to the ANOVA (Analysis of Variance) test, which is used to compare the means of different groups and determine if there are any statistically significant differences between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*Zmjm3sSuM_UPN0X9ijZqyw.jpeg" /><figcaption><a href="http://bbi.irri.org/products">http://bbi.irri.org/products</a></figcaption></figure><p><strong>Why use STAR ?<br>- </strong>STAR provides layout of experimental designs commonly used in research<br>- User friendly<br>- Open source and free access<br>- STAR provides descriptive analytics, ANOVA, T-test, Chi-square, Multivariate Analysis, Correlation, Regression</p><p><strong>Completely Randomized Design (CRD)<br></strong>Completely randomized design is the simplest type of experimental design . The reasons behind the use of a completely randomized design are as follows:<br>1. The experimental unit used is homogeneous or there are no other factors that affect the response outside of the factors being tried or studied.<br>2. External factors that can affect the experiment can be controlled. For example, an experiment conducted in a laboratory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*mLWmXZzAHpyQ7AB8ih6CBg.png" /><figcaption>Sample Table CRD</figcaption></figure><p><strong>Randomized Complete Block Design / Randomized Block Design (RBD)<br></strong>A randomized block design<strong> </strong>is a type of experiment where participants who share certain characteristics are grouped together to form <em>blocks</em>, and then the treatment (or intervention) gets randomly assigned within each block</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*4HtGHF_ompidE3r06wH6wA.png" /><figcaption>Sample Table RCBD</figcaption></figure><p><strong>ANOVA Test with STAR<br></strong>The following are the steps in conducting ANOVA testing with STAR :<br>- table format may not be in the form of cross tabulation<br>- save data in CSV format<br>- import data from Project Explorer tab : <strong>Data &gt;&gt; Import Data<br>- </strong>then<strong> </strong>select<strong> Analyze &gt;&gt; Analysis of Variance &gt;&gt; Completely Randomized Design / Randomized Complete Block Design</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*VozKGA_ETVFS_Zvms2j-Aw.png" /></figure><p><strong>Test Result and Interpretation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*ciqtVXdY-Qmg5kCETI-kRg.png" /></figure><blockquote>Factor hypothesis ANOVA Model Result Interpretation :<br>p-value = 0.0076<br>p-value &lt; 0.05, reject the null hypothesis</blockquote><blockquote>Ho: The population means of the factor are equal<br>Ha: There is one or more population means of the factor are not equal</blockquote><p>The options tab also provides functions to perform descriptive analysis, homogeneity test (Bartlett Test) and normality test (Shapiro-Wilk)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*TRPPWTD6Cw54tI1H0UBtqQ.png" /></figure><blockquote>Assumption Test Result Interpretation :<br>homogeneity test p-value = 0.7324, normality test p-value = 0.7256<br>p-value &lt; 0.05, reject the null hypothesis</blockquote><blockquote>Based on these tests, the data is proven to be homogeneous and normally distributed</blockquote><p>In this test, post hoc testing is also automatically carried out with Least Significant Difference (LSD) as the default for CRD but we can use another post hoc test such as Duncan Multiple Range Test (DMRT) or Tukey’s Honest Significant Difference (HSD)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*6hXcffldaUeP4ZKarNpDyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*-zFWddRReKEt9ywpUAVttw.png" /></figure><blockquote>Post Hoc Test Result Interpretation :<br>- B and D are not significantly different (LSD and DMRT)<br>- C and D are not significantly different (LSD)<br>- A and D are not significantly different (LSD)<br>- A, C and D are not significantly different (DMRT)</blockquote><p>Based on all the Experimental Design that have been carried out, it was found that there are variety with different result. Variety B has the highest mean score, B and D are not significantly different but A and C are significantly different with B</p><p>That’s the application of the Experimental Design with STAR, hopefully it’s easy to understand by everyone who needs this explanation</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12021e960de2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Applying Factor Analysis to Understand Viewer Preferences in TV Program Evaluation]]></title>
            <link>https://medium.com/@RaharditoDP/factor-analysis-b3c046ac3a28?source=rss-d632da2f7d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3c046ac3a28</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-scientist]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[Rahardito Dio Prastowo]]></dc:creator>
            <pubDate>Fri, 15 Apr 2022 08:31:23 GMT</pubDate>
            <atom:updated>2024-12-20T09:46:59.214Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Factor analysis </strong>is a statistical method used to describe variability among observed, correlated variables in terms of a potentially lower number of unobserved variables called factors. The purpose of factor analysis are :<br>- Identify data structures/variables<br>- Find a new set of variables that are fewer than the original variable<br>- Determine which original variables is a member of the new variable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*-n2Bhfc0xXEJQ7rInYigCw.png" /></figure><p><strong>Factor Analysis Steps<br></strong>1. Calculate the correlation matrix between variables<br>2. Correlation matrix testing (KMO test, MSA test)<br>3. Predict parameter / loading factor<br>4. Determine the number of factors<br> - eigen value is more than 1<br> - scree plot method<br>5. Factor rotation<br>6. Create label for the new factor</p><p><strong>KMO Test (Kaiser Meyer Olkin)</strong> is a method to determine how suited data is for factor analysis. The test measures sampling adequacy for each variable in the model. The higher KMO-value, the more suited the data is to factor analysis, the lower KMO-value, the more miserable or unacceptable the data is to factor analysis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*fw0Iv8V3osXLnxcMWOuf9Q.png" /></figure><p><strong>MSA Test (Measure of Sampling Adequacy)</strong> is a single value that is used to assess the adequacy of the inter-correlations of a set of variables and each variable for factor analysis<br>- if MSA score &lt; 0.5, then the variable is eliminated and not used in factor analysis<br>- after eliminating the variables, repeat the MSA test until there is no more score &lt; 0.5<br>- if there are more than one variable with score &lt; 0.5, eliminate the variable with the lowest score then do the MSA test until there is no score &lt; 0.5</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*BblXsiUrDsjsvl6a0sYIpw.png" /></figure><h3>Case Study</h3><p>In this case, we will use the dataset of TV Programs</p><blockquote>Suppose you work as Program Director team for a TV station, your superior asks you to analyze people’s interest in the type of television program</blockquote><blockquote>There are 10 programs that will be evaluated and taken from 40 respondents with multiple choices including 1 (not interesting), 2 (moderate) and 3 (very interesting), you can analyze people’s interest by finding out correlation between unobserved variable with the Factor Analysis</blockquote><pre># load dataset<br>dataset=read.csv(&quot;TV Program.csv&quot;,sep=&quot;;&quot;)<br># show table<br>View(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9j_XJCDILGQez-kNmjQ_AA.png" /></figure><pre># show data type<br>str(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k1x1-oHZUi-VziBzCetB8w.png" /></figure><p>Factor analysis started with KMO test and MSA test to eliminate variables with MSA score &lt;0.5</p><pre># correlation matrix test<br>library(psych)<br><br>KMO(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mIKUfewIv0amY8UEdCabHw.png" /></figure><p>Overall MSA score means KMO score, we get 0.6 for this so we can continue the factor analysis method. Because of there are several MSA scores &lt; 0.5 for each item, we get Movie variable has the lowest MSA score, we have to eliminate Movie variable, then do the KMO test again</p><pre>KMO(dataset[,-2])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3i0d0UkwGK44CuI35t6nag.png" /></figure><p>At this stage, because only the Talk Show variable has MSA score &lt;0.5, we eliminate the Talk Show variable, then the KMO test is carried out again</p><pre>KMO(dataset[,c(-2,-10)]) </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-5zfJbOzACvn2GdPjE5xSA.png" /></figure><p>Currently there is no variables that have MSA score &lt; 0.5, then we can create new dataset without Movie and Talk Show variable to conduct PCA and FA</p><pre>datasetnew=dataset[,c(-2,-10)]</pre><p>Show eigen value, then we can find out how many principal component</p><pre># show eigen value score of PCA<br>library(factoextra)<br>library(FactoMineR)<br><br>selectfactor &lt;- PCA(datasetnew,  graph = FALSE)<br>selectfactor$eig</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*F4r4mogdLL-e2n9oY3tgaQ.png" /></figure><p>After we get how many principal components, then we can perform the factor analysis method with the number of principal components</p><pre># show Factor Analysis Score<br>resultfactor &lt;- factanal(datasetnew,  factors = 2,rotation=&quot;varimax&quot;)<br>resultfactor$loadings</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*25dIJFoMq4JCKQ5jTPCeog.png" /></figure><p>After we get the result of Factor Analysis, we can choose a higher number between factor 1 and factor 2 without considering the negative sign then we can give a label name to each group based on the suitability for the character of the group. In this case, group 1 (Music, Comedy, Cartoon, Series, Sports) we can use “entertainment” for the label name and group 2 (News, Religion, History) we can use “non entertainment” for the label name<br>Based on the analysis that has been carried out, there are internal relationship between the scoring variables which are divided into 2 groups. In this case, we can use these two groups as factors that influence people’s interest in the theme of TV program</p><p>That’s the application of the Factor Analysis in R using a simple dataset, hopefully it’s easy to understand by everyone who needs this explanation</p><p><a href="https://github.com/RaharditoDio/Data-Reduction/blob/main/Factor%20Analysis%20Medium.R">https://github.com/RaharditoDio/Data-Reduction/blob/main/Factor%20Analysis%20Medium.R</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3c046ac3a28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Principal Component Analysis with Biplot Analysis to Enhance Branch Performance Evaluation]]></title>
            <link>https://medium.com/@RaharditoDP/principal-component-analysis-with-biplot-analysis-in-r-ee39d17096a1?source=rss-d632da2f7d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee39d17096a1</guid>
            <category><![CDATA[data-scientist]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[r-programming]]></category>
            <dc:creator><![CDATA[Rahardito Dio Prastowo]]></dc:creator>
            <pubDate>Sun, 10 Apr 2022 19:49:14 GMT</pubDate>
            <atom:updated>2024-12-20T09:45:40.170Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Principal Component Analysis</strong> is a dimensionality-reduction method that is often used to reduce the dimensionality of large dataset. The purpose of reducing the variable are :<br>- make a ranking of observations based on several variables<br>- overcoming multi-collinearity<br>- create data visualization (biplot)</p><ul><li>Transforms the original variables to principal components. The principal components are a linear combinations set of the original variables, the relationship between components is orthogonal and uncorrelated</li><li>Linear combination with the largest variances are the chosen combination. The amount of variance from each principal component is measured by eigenvalues</li><li>The total variance of principal components between 70%, 80% and 90% of total variance of original variables and eigen value is more than 1</li><li>Or the total variance of principal components determined based on the difference between the eigen values ​​starting to converge or the difference is not large</li></ul><p><strong>Biplot Analysis</strong> is an exploratory graph method used in statistic with two-dimensional chart that represents of multidimensional dataset</p><blockquote>Representation of angle degrees between two variables :<br>- 90 degree, there is no correlation between two variable<br>- less than 90 degree, there is positive correlation between two variable<br>- more than 90 degree, there is negative correlation between two variable</blockquote><blockquote>Representation of vector line length :<br>vector line length represent the variance level of variable<br>- the longer the vector line, the greater the variance<br>- the shorter the line, the less the variance</blockquote><blockquote>Representation of object and variable :<br>- the closer distance of the object to the variable direction, the higher the value of the variable for that object<br>- the farther distance of the object to the variable direction, the lower the value of the variable for that object<br>- the closer distance of two object means the value of the variable is close</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y_MFtBBK1RDmZIJ5CqG7DA.png" /></figure><h4><strong>Case Study</strong></h4><p>In this case, we will use the dataset of Branch Evaluation</p><blockquote>Suppose you work as Area Coordinator for several branches, your superior asks you to analyze the performance of each branch</blockquote><blockquote>There is a dataset consisting of several variables including Service, Product, Facility, Price, Campaign, Security, Location, you can analyze the performance of each branch with the Principal Component Analysis with Biplot Analysis</blockquote><pre># load dataset<br>dataset &lt;- read.csv(&quot;BranchEvaluation.csv&quot;,sep=&quot;;&quot;)<br># show table<br>View(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*0AhtDr16FqCrDrYnhUndJA.png" /></figure><pre># show data type<br>str(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0EG7QBAfsO6sspnFkti88w.png" /></figure><p>The principal component analysis can only be done with numerical data, so we need to make categorical data into row names</p><pre># create coloumn branch become row names<br>datasetnew &lt;- dataset[,-1]<br>rownames(datasetnew) &lt;- dataset[,1]<br>View(datasetnew)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*UxNKssNj5MYW2DX3ECph0g.png" /></figure><pre># show eigen value score of PCA<br>library(factoextra)<br>library(FactoMineR)<br><br>res.pca &lt;- PCA(datasetnew,  graph = FALSE)<br>res.pca$eig</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*mgi8XtoMOcMZnuVXjnUFVQ.png" /></figure><p>There are only 2 components that have more than 1 of eigen value score (comp 1 &amp; comp 2), so these 2 components can be used for the next method</p><pre># show scree plot of PCA<br>fviz_screeplot(res.pca, addlabels = TRUE)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sksYY-NwFFo7vHfS1oCS7g.png" /></figure><p>We can also use the scree plot to find which main component we are going to use by determining where the graph points start to converge, the graph show that the line is starting to converge at the comp 3, so we can use comp 1 and comp 2</p><pre># show pricipal component score<br>res.pca$ind$coord</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*o92lUP0VpjnnWS2LwxlqVw.png" /></figure><p>After using the eigen values for determining how many components we can use, then we can use the principal component values ​​as variables in the next test</p><pre># show graph of two dimensional variable<br>fviz_pca_ind(res.pca, col.ind = &quot;cos2&quot;, gradient.cols = c(&quot;#00AFBB&quot;, &quot;#E7B800&quot;, &quot;#FC4E07&quot;), repel = TRUE)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qLvHC_5AHF6RMBxs2_Ph7Q.png" /></figure><p>The two-dimensional graph shows the position of the coordinates where we can find which branch has almost the same assessment results and to be more leverage we can continue this analysis by using a biplot graph</p><pre># show graph of biplot analysis<br>fviz_pca_biplot(res.pca, repel = TRUE)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tFS2Sis3aq9xLdP21wWDAw.png" /></figure><blockquote>Biplot Analysis Interpretation :<br>- The vector length of all variables is relatively the same, only the service variable have the variable with the longest line<br>- Service variable has the largest variance of values ​​than other variables<br>- Facility, product and location variables have a strong positive correlation because they have very small degree between two lines<br>- Service and price variables have a weak positive correlation because the degree between two lines is close to 90<br>- Service and campaign variables have a negative correlation because the degree between two lines is more than 90</blockquote><p>That’s the application of the Principal Component Analysis with Biplot Analysis in R using a simple dataset, hopefully it’s easy to understand by everyone who needs this explanation</p><p><a href="https://github.com/RaharditoDio/Data-Reduction/blob/main/PCA%20with%20Biplot%20Medium.R">https://github.com/RaharditoDio/Data-Reduction/blob/main/PCA%20with%20Biplot%20Medium.R</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee39d17096a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multiple Linear Regression in R]]></title>
            <link>https://medium.com/@RaharditoDP/multiple-linear-regression-in-r-80098155ea5e?source=rss-d632da2f7d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/80098155ea5e</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[Rahardito Dio Prastowo]]></dc:creator>
            <pubDate>Mon, 28 Feb 2022 10:37:21 GMT</pubDate>
            <atom:updated>2022-04-15T18:37:57.286Z</atom:updated>
            <content:encoded><![CDATA[<p>Multiple linear regression is used to measure relationships between a dependent variable and two or more independent variables with a linear equation, the objective of this method not only for measure the relationship but also to predict the value of an output variable (or response) based on the value of two or more input (or predictor) variable. The following are examples of multiple linear regression equations :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*hQE8SADJkMLAxtSIH6b6uw.png" /></figure><blockquote>Characteristics Multiple Linear Regression :<br>- variables x and y have a linear relationship<br>- residual has constant variance<br>- there is no auto correlation on residual<br>- residuals are normally distributed<br>- there is no correlation between independent variable (multi-collinearity)</blockquote><blockquote>- Correlation hypothesis :<br>assumes that there is a correlation between two variable<br>Ho: variable x (independent) has no effect on variable Y (dependent)<br>Ha: variable x (independent) has an effect on variable Y (dependent)</blockquote><p>When your <strong>p-value is less than or equal to your significance level (0.05)</strong>, you reject the null hypothesis, then we use the following table to interpret the correlation</p><p>In multiple linear regression analysis modeling, we will get the value of Adjusted Coefficient of Determination (Adj R Squared), Coefficient of Determination is used to analyze how differences in first variable can be explained by a difference in the second variable. In this multiple linear regression, there are two tests that are not performed on the simple linear regression test, the tests are Simultaneous F-test and Partial T-test</p><blockquote>Simultaneous F-test hypothesis :<br>Ho: all variable x (independent) has no effect on variable Y (dependent)<br>Ha: minimum one of all variable x (independent) has an effect on variable Y (dependent)</blockquote><blockquote>Partial T-test hypothesis (single variable) :<br>Ho: variable x1 or x2 or xk (independent) has no effect on variable Y (dependent)<br>Ha: variable x1 or x2 or xk (independent) has an effect on variable Y (dependent)</blockquote><blockquote>(Adjusted) Coefficient of Determination :<br>- it assigns a value between 0 and 1<br>- 1 is the best value of linear regression model</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOTkmnncTHKMHRVFsWpmxw.png" /></figure><h4>Case Study</h4><p>In this case, we will use the dataset of house prices</p><blockquote>A study was conducted to determine the effect of the total area, age of building and university location on the house prices</blockquote><pre># load dataset<br>dataset &lt;- read.csv(&#39;House Price.csv&#39;, stringsAsFactors = T)<br># show table<br>View(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*31AY7GY15hGY3kMCLsQQKw.png" /></figure><p>Show the data type to make sure the type of variable we are going to test, price is continuous variable</p><pre># show data type<br>str(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uPhD8QrXeku7YozXRaZlVQ.png" /></figure><p>Show the data plot to see whether the data forms if there is correlation between two variable</p><pre># show variable correlation<br>pairs(~ Price + Area + Age + University, data=dataset, lower.panel=NULL)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dYmoXIVHWTnx3YTBJ9B1GQ.png" /></figure><p>Before doing the modeling process we have to convert factor variable to numerical variable then select only the numerical variable on the dataset</p><pre># crate column for conversion university variable <br>dataset$University2 &lt;- ifelse(dataset$University==&quot;Yes&quot;, 1, 0)</pre><pre># select only numerical variable<br>library(dplyr)<br>datasetnum &lt;- select_if(dataset, is.numeric)<br>View(datasetnum)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*Gypq5uKnMKn8HJDGd6uWOw.png" /></figure><p>We can generate correlation value, p-value of the correlation and show the correlation plot to see the correlation of each variable</p><pre># correlation value<br>library(ggcorrplot)<br>corr &lt;- round(cor(datasetnum), 3)<br>corr</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9jqeOxfu-cVqERwqvG3mNA.png" /></figure><pre># p-value of correlation<br>p.mat &lt;- cor_pmat(datasetnum)<br>p.mat</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KyW4nt6VlriplmPmtJ3COA.png" /></figure><pre># show plot<br>ggcorrplot(corr,hc.order = TRUE,type = &quot;lower&quot;, p.mat = p.mat,lab=T)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*6XpKObtk0KYGMQUTblVatA.png" /></figure><blockquote>Correlation Test Result Interpretation :<br>corr value, define strength and direction of the correlation<br>pmat value, define is there any correlation of the variables</blockquote><blockquote>- Correlation value (corr) :<br>- it assigns a value between -1 and 1<br>- 1 is the best value of positive correlation, -1 is the best value of negative correlation</blockquote><blockquote>- Correlation hypothesis (pmat) :<br>assumes that there is a correlation between variables<br>Ho: variable x (independent) has no effect on variable Y (dependent)<br>Ha: variable x (independent) has an effect on variable Y (dependent)</blockquote><pre># create linear model<br>modelreg &lt;- lm(Price ~ Area + Age + University, data=dataset)<br>summary(modelreg)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*semL6lnc7a2xkke3vt_dzQ.png" /></figure><blockquote>Multiple Linear Regression Result Interpretation :<br>- Simultaneous F-test hypothesis :<br>p-value = 2.2e-16<br>p-value &lt; 0.05, reject the null hypothesis</blockquote><blockquote>Ho: the value of total area, age of building and university location has no effect on house prices<br>Ha: <strong>minimum one variable of total area, age of building and university location has an effect on house prices</strong></blockquote><blockquote>- Partial T-test hypothesis (single variable) :<br>a. total area : 2e-16 <br>b. age of building : 0.000373<br>c. university location : 2e-16</blockquote><blockquote>p-value &lt; 0.05, reject the null hypothesis</blockquote><blockquote>Ho: variable X (independent) has no effect on variable Y (dependent)<br>Ha: <strong>variable X (independent) has an effect on variable Y (dependent)</strong></blockquote><blockquote>- Multiple Linear Regression Model :<br>Y : house prices<br>Bo : 7.874<br>B1 : 8.339<br>B2 : -0.185<br>B3 : 60.259 (if university location is 1)<br>X : total area, age of building and university location<br>Model &gt;&gt; house prices : 7.874 + 8.339(total area) — 0.185(age of building) + 60.259 (if university location is 1)</blockquote><blockquote>- Goodness-of-fit models :<br>R-squared : 0.8662<br>86.62% of house prices variance can be defined by all variables independent</blockquote><p>We can make sure all the characteristics of the linear regression model in the dataset are met before implementing the model</p><pre># homogeneity test<br>library(lmtest)<br>bptest(modelreg)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ClWWtE9BrmTkMmpVqM94Pg.png" /></figure><blockquote>Homogeneity Test Result Interpretation :<br>p-value = 0.7681<br>p-value &gt; 0.05, fail to reject the null hypothesis</blockquote><blockquote><strong>Ho: the variance of residual is homogeneous</strong><br>Ha: the variance of residual is not homogeneous</blockquote><pre># autocorrelation test<br>library(car)<br>durbinWatsonTest(modelreg)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gpZq3fv94GviZ_7hGEBnSA.png" /></figure><blockquote>Autocorrelation Test Result Interpretation :<br>p-value = 0.866<br>p-value &gt; 0.05, fail to reject the null hypothesis</blockquote><blockquote>Ho: <strong>there is no auto correlation in the residual variance</strong><br>Ha: there is auto correlation in the residual variance</blockquote><pre># notmality test<br>library(car)<br>vif(modelreg)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*32yIy3YLyr-n0exPf4YsRA.png" /></figure><pre>shapiro.test(modelreg$residuals)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bkfUDj3yLU08eqYvZSeZhQ.png" /></figure><blockquote>Normality Test Result Interpretation :<br>p-value = 0.4132<br>p-value &gt; 0.05, fail to reject the null hypothesis</blockquote><blockquote>Ho: <strong>the variance of residual is normally distributed</strong><br>Ha: the variance of residual is not normally distributed</blockquote><p>After getting a multiple linear regression model we can implement the model by providing data on the independent variables of the model</p><blockquote>how much the prediction of house prices with the specifications in the following table ?</blockquote><pre># prediction with model<br>datatest &lt;- read.csv(&#39;PredictTest.csv&#39;, stringsAsFactors = T)<br>datatest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zW0KR0U8pprtokiLr60-Q.png" /></figure><pre>datatest$price_prediction &lt;- predict(modelreg, datatest)<br>View(datatest)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*0I-EILS_gmewSiFsYT2DBg.png" /></figure><p>Based on all the tests that have been done, it was found that the total area, age of building and university location affects the house prices</p><p>That’s the application of the Multiple Linear Regression Model in R using a simple dataset, hopefully it’s easy to understand by everyone who needs this explanation</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80098155ea5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Application of Simple Linear Regression Analysis in Predicting House Prices]]></title>
            <link>https://medium.com/@RaharditoDP/simple-linear-regression-in-r-6e71b8404851?source=rss-d632da2f7d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e71b8404851</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Rahardito Dio Prastowo]]></dc:creator>
            <pubDate>Mon, 28 Feb 2022 04:53:46 GMT</pubDate>
            <atom:updated>2024-12-20T09:43:36.283Z</atom:updated>
            <content:encoded><![CDATA[<p>Regression analysis is a statistical methods to measure relationships between a dependent variable and one or more independent variables, there are several types of regression analysis methods, we will start by discussing the simple linear regression method<br>Simple linear regression is used to measure the relationship between two continuous variables with a linear equation, the objective of this method not only for measure the relationship but also to predict the value of an output variable (or response) based on the value of an input (or predictor) variable. The following are examples of linear regression equations and also non-linear regression :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*nI_o9xb6NSncPzCoM1wA9Q.png" /></figure><blockquote>Characteristics Simple Linear Regression :<br>- variables x and y have a linear relationship<br>- residual has constant variance<br>- there is no auto correlation on residual <br>- residuals are normally distributed</blockquote><blockquote>- Correlation hypothesis :<br>assumes that there is a correlation between two variable<br>Ho: variable x (independent) has no effect on variable Y (dependent)<br>Ha: <strong>variable x (independent) has an effect on variable Y (dependent)</strong></blockquote><p>When your <strong>p-value is less than or equal to your significance level (0.05)</strong>, you reject the null hypothesis, then we use the following table to interpret the correlation</p><p>In regression analysis modeling, we will get the value of Coefficient of Determination (R Squared), Coefficient of Determination is used to analyze how differences in first variable can be explained by a difference in the second variable</p><p><em>Characteristics Coefficient of Determination :<br>- it assigns a value between 0 and 1<br>- 1 is the best value of linear regression model</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOTkmnncTHKMHRVFsWpmxw.png" /></figure><h3>Case Study</h3><p>In this case, we will use the dataset of sales</p><blockquote><em>A study was conducted to determine the effect of the total area on the house prices</em></blockquote><pre># load dataset<br>dataset &lt;- read.csv(&#39;House Price.csv&#39;, stringsAsFactors = T)<br># show table<br>View(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*aSUCWWCr7l963bmQKDRXSg.png" /></figure><p>Show the data type to make sure the type of variable we are going to test, Area and Price are continuous variable</p><pre># show data type<br>str(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDrT-Fc-6_-iCwUT0GZ5zQ.png" /></figure><p>Show the data plot to see whether the data forms if there is correlation between two variable</p><pre># show plot<br>library(ggplot2)<br>ggplot(dataset, aes(x=Area, y=Price)) + geom_point()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*321oQ5117do0EUvnDDMs4g.png" /></figure><p>Before doing the modeling process we can do correlation test to prove that there is a linear correlation between two variables</p><pre># correlation test<br>cor.test(dataset$Price, dataset$Area)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ui6_TBxrzJkWyAj0Di7Yg.png" /></figure><blockquote>Correlation Test Result Interpretation :<br>p-value = 2.2e-16<br>p-value &lt; 0.05, reject the null hypothesis</blockquote><blockquote>Ho: There is no linear correlation between price and area<br>Ha: <strong>There is linear correlation between price and area</strong></blockquote><pre># create linear model<br>model1 &lt;- lm(Price~Area, data=dataset)<br>summary(model1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTcyFy3bC4OcyEFZMmSYNg.png" /></figure><blockquote>Linear Regression Result Interpretation :<br>- F-stats : <br>p-value = 2.2e-16<br>p-value &lt; 0.05, reject the null hypothesis</blockquote><blockquote>Ho: The amount of total area does not affect the house price<br>Ha: <strong>The amount of total area affect the house price</strong></blockquote><blockquote>- Linear Regression Model :<br>Y : price<br>Bo : 30.9203<br>B1 : 8.5973<br>X : area<br>Model &gt;&gt; <strong>price : 30.9203 + 8.5973(area)</strong></blockquote><blockquote>- Goodness-of-fit models :<br>R-squared : 0.3536<br>35.36% of total sales variance can be defined by advertising costs</blockquote><p>We can make sure all the characteristics of the linear regression model in the dataset are met before implementing the model</p><pre># homogeneity test<br>library(lmtest)<br>bptest(model1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4EYF6YY3GL7jB5j99zHSzg.png" /></figure><blockquote>Homogeneity Test Result Interpretation :<br>p-value = 0.001552<br>p-value &lt; 0.05, reject the null hypothesis</blockquote><blockquote>Ho: the variance of residual is homogeneous<br>Ha:<strong> the variance of residual is not homogeneous</strong></blockquote><pre># autocorrelation test<br>library(car)<br>durbinWatsonTest(model1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFG7SQcrZW_iaQHiDNJ0SA.png" /></figure><blockquote>Autocorrelation Test Result Interpretation :<br>p-value = 0.258<br>p-value &gt; 0.05, fail to reject the null hypothesis</blockquote><blockquote>Ho: <strong>there is no auto correlation in the residual variance</strong><br>Ha: there is auto correlation in the residual variance</blockquote><pre># notmality test<br>shapiro.test(model1$residuals)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Qb7jLnyJaBsqlb5yMedXw.png" /></figure><blockquote>Normality Test Result Interpretation :<br>p-value = 2.2e-16<br>p-value &lt; 0.05, reject the null hypothesis</blockquote><blockquote>Ho: the variance of residual is normally distributed<br>Ha: <strong>the variance of residual is not normally distributed</strong></blockquote><p>After getting a linear regression model we can’t implement the model because the requirements for the homogeneity and normality test are not met</p><p>That’s the application of the Linear Regression Model in R using a simple dataset, hopefully it’s easy to understand by everyone who needs this explanation</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e71b8404851" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cramer’s V Correlation in R]]></title>
            <link>https://medium.com/@RaharditoDP/cramers-v-correlation-in-r-1eed5a5432ae?source=rss-d632da2f7d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1eed5a5432ae</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Rahardito Dio Prastowo]]></dc:creator>
            <pubDate>Fri, 25 Feb 2022 11:17:43 GMT</pubDate>
            <atom:updated>2022-04-09T23:33:26.755Z</atom:updated>
            <content:encoded><![CDATA[<p>Cramer’s V Correlation is used to measure the strength of the relationship between categorical variable (2 levels) and categorical variable (more than 2 levels)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*1lMoskaV8QdL6ESUkySd3Q.png" /></figure><blockquote>Characteristics Cramer’s V Correlation Coefficient :<br>- it assigns a value between 0 and 1<br>- 0 is no correlation between two variable</blockquote><blockquote>- Correlation hypothesis :<br>assumes that there is a correlation between two variable<br>Ho: There is no correlation between two variable<br>Ha: There is correlation between two variable</blockquote><p>When your <strong>p-value is less than or equal to your significance level (0.05)</strong>, you reject the null hypothesis, then we use the following table to interpret the correlation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*CyOpU78o7c4OR_Qlj62EkA.png" /></figure><h4>Case Study</h4><p>In this case, we will use the dataset of bookstore</p><blockquote>Suppose you work in the Sales Department of a bookstore, your superior asks you to analyze customer reading interest in the types of books available in the store</blockquote><blockquote>There is a dataset consisting of several variables including Author, User Rating, Review, Price, Year, Genre and Sales, your team have to know the correlation between <em>genre of the book and </em>the release year of the book with the Cramer’s V Correlation method</blockquote><pre># load dataset<br>dataset&lt;- read.csv(&#39;BooksSales.csv&#39;, stringsAsFactors = T)<br># show table<br>View(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/0*kq2dz7M7eWpe1dj0.png" /></figure><p>Show the data type to make sure the type of variable we are going to test, Release Year and Genre are categorical variable</p><pre># show data type<br>str(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lw5Q5Bd0_DMi5iF9BaFPgg.png" /></figure><p>Change the data type of variable “Year” to categorical (factor)</p><pre># change data type<br>dataset$Year = as.factor(dataset$Year)</pre><p>Show the data plot to see whether the data forms if there is correlation between two categorical variable</p><pre># show plot<br>library(ggplot2)<br>ggplot(dataset, aes(x=Year, fill=Genre)) + geom_bar(position=&#39;fill&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jgZQoA8gWXParErzXsuvTQ.png" /></figure><p>We have to create a new table to show the frequency of each variable then with the data in this table we will do the next testing process</p><pre># create table of frequency<br>table &lt;- table(dataset$Genre,dataset$Year)<br>table</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lh3njBnfCz6faDaivK_zVA.png" /></figure><pre># correlation test<br>library(rcompanion)<br>cramerV(table)<br>chisq.test(dataset$Sales,dataset$Year)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xbQvk6B9V7tNFdkM4-jGOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_SDR_HhWBBfRyTyxcGvuWQ.png" /></figure><blockquote>Correlation Test Result Interpretation :<br>p-value = 0.3535<br>p-value &gt; 0.05, failed to reject the null hypothesis</blockquote><blockquote>Ho: <strong>There is no correlation between genre and release year</strong><br>Ha: There is correlation between genre and release year</blockquote><p>Based on all the Cramer’s V Correlation tests that have been carried out, it was found that there is no correlation between genre and release year</p><p>That’s the application of the Cramer’s V Correlation in R using a simple dataset, hopefully it’s easy to understand by everyone who needs this explanation</p><p><a href="https://github.com/RaharditoDio/Hypothesis-Testing/blob/main/Cramer%E2%80%99s%20V%20Correlation%20Medium.R">https://github.com/RaharditoDio/Hypothesis-Testing/blob/main/Cramer%E2%80%99s%20V%20Correlation%20Medium.R</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eed5a5432ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Phi Correlation Coefficient in R]]></title>
            <link>https://medium.com/@RaharditoDP/phi-correlation-coefficient-ee86c3855ce2?source=rss-d632da2f7d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee86c3855ce2</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Rahardito Dio Prastowo]]></dc:creator>
            <pubDate>Fri, 25 Feb 2022 08:33:57 GMT</pubDate>
            <atom:updated>2022-04-09T23:35:28.106Z</atom:updated>
            <content:encoded><![CDATA[<p>Phi Correlation Coefficient is used to measure the strength of the relationship between categorical variable (2 levels) and categorical variable (2 levels)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*RxNC2WtRWGYEnRA1xCNylg.png" /></figure><blockquote>Characteristics Phi Correlation Coefficient :<br>- it assigns a value between 0 and 1<br>- 0 is no correlation between two variable</blockquote><blockquote>- Correlation hypothesis :<br>assumes that there is a correlation between two variable<br>Ho: There is no correlation between two variable<br>Ha: There is correlation between two variable</blockquote><p>When your <strong>p-value is less than or equal to your significance level (0.05)</strong>, you reject the null hypothesis, then we use the following table to interpret the correlation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*NLMg5D2K0xohv2HqbKP5SA.png" /></figure><h4>Case Study</h4><p>In this case, we will use the dataset of bookstore</p><blockquote>Suppose you work in the Sales Department of a bookstore, your superior asks you to analyze customer reading interest in the types of books available in the store</blockquote><blockquote>There is a dataset consisting of several variables including Author, User Rating, Review, Price, Year, Genre and Sales, your team have to know the correlation between the genre of the book and sales performance (good or under) with the Phi Correlation Coefficient method</blockquote><pre># load dataset<br>dataset &lt;- read.csv(&#39;BooksSales.csv&#39;, stringsAsFactors = T)<br># show table<br>View(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*A_FjjzrvEwFq-CvlXP7pFw.png" /></figure><p>Show the data type to make sure the type of variable we are going to test, Sales and Genre are categorical variable (2 levels)</p><pre># show data type<br>str(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o86K017mTQ7OLaKtL78HIA.png" /></figure><p>Show the data plot to see whether the data forms if there is correlation between two categorical variable</p><pre># show plot<br>library(ggplot2)<br>ggplot(dataset, aes(x=Sales, fill=Genre)) + geom_bar(position=&#39;fill&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jLAOsmyYwWxDHgLPTYAPDA.png" /></figure><p>We have to create a new table to show the frequency of each variable then with the data in this table we will do the next testing process</p><pre># create table of frequency<br>table &lt;- table(dataset$Genre,dataset$Sales)<br>table</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HgN-G0Xfj4K0xene7u9aug.png" /></figure><pre># correlation test<br>library(psych)<br>abs(phi(table)) </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qa1uuQmCMDFnkWfAG-xlDw.png" /></figure><pre>chisq.test(dataset$Genre,dataset$Sales)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jOs5dBR7IQgZIpkwz7w54w.png" /></figure><p><em>- Correlation Test Result Interpretation :<br>p-value = 5.967e-08<br>p-value &lt; 0.05, reject the null hypothesis</em></p><p><em>Ho: There is no correlation between genre and sales performance<br>Ha: </em><strong><em>There is correlation between genre and sales performance</em></strong></p><p>Based on all the Phi Correlation Coefficient tests that have been carried out, it was found that there is strong correlation (r = 0.24) between genre and sales performance with strong correlation, it’s likely that the fiction books get better sales performance</p><p>That’s the application of the Phi Correlation Coefficient Test in R using a simple dataset, hopefully it’s easy to understand by everyone who needs this explanation</p><p><a href="https://github.com/RaharditoDio/Hypothesis-Testing/blob/main/Phi%20Correlation%20Coefficient%20Medium.R">https://github.com/RaharditoDio/Hypothesis-Testing/blob/main/Phi%20Correlation%20Coefficient%20Medium.R</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee86c3855ce2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Point-Biserial Correlation in R]]></title>
            <link>https://medium.com/@RaharditoDP/point-biserial-correlation-in-r-70e713caa7a0?source=rss-d632da2f7d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/70e713caa7a0</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Rahardito Dio Prastowo]]></dc:creator>
            <pubDate>Sun, 20 Feb 2022 19:14:42 GMT</pubDate>
            <atom:updated>2022-04-09T23:34:19.195Z</atom:updated>
            <content:encoded><![CDATA[<p>Point-biserial correlation is used to measure the strength and direction of the relationship between one continuous (numerical) variable and categorical variable (2 levels)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*p3zmVE8BEvsRhzUvecuZEg.png" /></figure><blockquote>Characteristics Spearman Correlation :<br>- it assigns a value between − 1 and 1<br>- 0 is no correlation between two variable<br>- 1 is total positive correlation between two variable, — 1 is total negative correlation between two variable</blockquote><blockquote>- Correlation hypothesis :<br>assumes that there is a correlation between two variable<br>Ho: There is no correlation between two variable<br>Ha: There is correlation between two variable</blockquote><p>When your<strong> p-value is less than or equal to your significance level (0.05)</strong>, you reject the null hypothesis, then we use the following table to interpret the correlation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*McUCPbf_yGeTzEZbEihfSA.png" /></figure><h4>Case Study</h4><p>In this case, we will use the dataset of bookstore</p><blockquote>Suppose you work in the Sales Department of a bookstore, your superior asks you to analyze customer reading interest in the types of books available in the store</blockquote><blockquote>There is a dataset consisting of several variables including Author, User Rating, Review, Price, Year, Genre and Sales, your team have to know the correlation between the genre of the book and the number of people who review the book on each genres with the Point-Biserial Correlation method</blockquote><pre># load dataset<br>dataset &lt;- read.csv(&#39;BooksSales.csv&#39;, stringsAsFactors = T)<br># show table<br>View(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*5NunoAmwTG_SH9f0T3P2KA.png" /></figure><p>Show the data type to make sure the type of variable we are going to test, Reviews is numerical variable; Genre is categorical variable (2 levels)</p><pre># show data type<br>str(dataset)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X_fo4MOuDjPZVeZgwt4fBw.png" /></figure><p>Show the data plot to see whether the data forms if there is difference between 2 level of categorical variable</p><pre># show plot<br>library(ggplot2)<br>ggplot(dataset, aes(x=Genre, y=Reviews)) + geom_point()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s6tPiwaFV0oUY2Lf8R79PA.png" /></figure><p>We have to create a new column to input the value of the conversion from categorical variable to numerical variable then with the data in this column we will do the next testing process</p><pre># convert categorical to numerical<br>dataset$Genre2 &lt;- ifelse(dataset$Genre==&quot;Fiction&quot;, 1, 0)</pre><pre># correlation test<br>cor.test(dataset$Reviews, dataset$Genre2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6MhuSVK6N0o08h7Teg9PMQ.png" /></figure><blockquote>- Correlation Test Result Interpretation :<br>p-value = 2.274e-11<br>p-value &lt; 0.05, reject the null hypothesis</blockquote><blockquote>Ho: There is no correlation between Reviews and Genre<br>Ha: <strong>There is correlation between Reviews and Genre</strong></blockquote><p>Based on all the Point-biserial correlation tests that have been carried out, it was found that there is correlation between <em>Reviews and Genre </em>with normal correlation, fiction book have higher reviews than those non fiction book</p><p>That’s the application of the Point-Biserial Correlation in R using a simple dataset, hopefully it’s easy to understand by everyone who needs this explanation</p><p><a href="https://github.com/RaharditoDio/Hypothesis-Testing/blob/main/Point%20Biserial%20Correlation%20Medium.R">https://github.com/RaharditoDio/Hypothesis-Testing/blob/main/Point%20Biserial%20Correlation%20Medium.R</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70e713caa7a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>