<?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 Samarth Malik on Medium]]></title>
        <description><![CDATA[Stories by Samarth Malik on Medium]]></description>
        <link>https://medium.com/@samarthmalik06?source=rss-a723f3ffb2e7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bSLjYGsP3WysbpSqd8nmEg.jpeg</url>
            <title>Stories by Samarth Malik on Medium</title>
            <link>https://medium.com/@samarthmalik06?source=rss-a723f3ffb2e7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 13:49:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samarthmalik06/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[Why telling a toddler to “calm down” doesn’t work]]></title>
            <link>https://medium.com/@samarthmalik06/why-telling-a-toddler-to-calm-down-doesnt-work-940173c69259?source=rss-a723f3ffb2e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/940173c69259</guid>
            <category><![CDATA[toddlers]]></category>
            <category><![CDATA[emotional-intelligence]]></category>
            <category><![CDATA[parenting]]></category>
            <category><![CDATA[child-psychology]]></category>
            <dc:creator><![CDATA[Samarth Malik]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 21:07:26 GMT</pubDate>
            <atom:updated>2026-04-14T21:07:26.819Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>I tried logic on my three-year-old. It made things worse.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yM8wkvYKUDTk4izp746lyw.png" /><figcaption>Sometimes they don’t need a solution. Just someone to sit with them.</figcaption></figure><p>Last week, my three-year-old cried for twenty minutes because I poured her milk into the wrong cup.</p><p>It was the same milk. Just a different cup. That was the whole issue.</p><p>I did what felt natural. I crouched down, tried to keep my voice calm, and said, “It’s the same milk, beta. Just drink it.”</p><p>It didn’t help. If anything, it seemed to make things worse.</p><p>I kept thinking about it later. Not because this was unusual. It happens. But more because of how quickly I went into fix mode.</p><p>First I explained. Then I repeated myself. Then, at some point, I got a little firmer without really realising it.</p><p>And still, nothing changed.</p><p>At some point it hit me that she wasn’t in a state where explanation even mattered.</p><p>When a toddler is in the middle of a meltdown, logic is just… not really available.</p><p>The part of the brain that helps us pause, think things through, and control our reactions, the prefrontal cortex, is still developing. That ability to take a sentence like “it’s okay” and actually use it to calm yourself just isn’t there yet.</p><p>What’s more active instead is the amygdala, the brain’s alarm system. When that kicks in, the body reacts before there’s any time to think things through.</p><p>So from her side, something felt wrong. That was enough.</p><p>It didn’t matter that the milk was the same. Her system had already decided that something was off.</p><p>From the outside, it looks small. From their side, it really isn’t.</p><p>And that’s usually where things start to go wrong for us as adults.</p><p>We step in trying to fix it quickly. We explain, correct, reassure. Sometimes we raise our voice a bit, not out of anger, but urgency.</p><p>We just want it to stop.</p><p>But in that moment, all of that can feel like more pressure.</p><p>Looking back, I don’t think I was helping. I was probably just adding more intensity into a moment that already had too much of it.</p><p>I don’t get this right all the time, even now. Far from it. But I’ve changed a couple of things.</p><p>The first is physical. I get down to her level. Not as a technique, it just changes the feel of the interaction. It feels less like I’m talking at her.</p><p>The second is that I say less.</p><p>Instead of trying to fix it, I just acknowledge what’s happening. “You’re upset.” Sometimes just, “I know.”</p><p>I’m not agreeing that the situation is a big deal. I’m just not arguing with how she feels in that moment.</p><p>It sounds too simple to work, but it does something.</p><p>It slows things down a bit. There’s less back and forth. Not instantly, but gradually, something softens.</p><p>I don’t think it’s really about the exact words. It’s more about the signal.</p><p>I’m here. I’m not trying to win this.</p><p>The harder part, honestly, is managing myself.</p><p>Because if I’m tense, she stays tense. If I slow down, even a little, she eventually follows.</p><p>Not immediately. But it does shift.</p><p>This reminded me of something we often say at work.</p><p>Don’t design for the user you wish you had. Design for the user in front of you.</p><p>I realised I was doing the opposite at home. I was expecting a three-year-old to behave like someone who can process logic, someone who can regulate themselves just because something has been explained clearly.</p><p>She can’t. Not yet.</p><p>She’s not being difficult.</p><p>She’s overwhelmed.</p><p>That doesn’t make these moments easy. It still takes patience I don’t always have.</p><p>But it does change how I show up, at least a little.</p><p>Next time it happens, and it will, I’m trying to remember one thing.</p><p>Just don’t make it worse.</p><p>If you’ve ever tried to reason with a child mid-meltdown and watched it backfire, you probably know what I mean.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=940173c69259" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Analysis and Visualisations using R]]></title>
            <link>https://medium.com/data-science/data-analysis-and-visualisations-using-r-955a7e90f7dd?source=rss-a723f3ffb2e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/955a7e90f7dd</guid>
            <category><![CDATA[r-programming]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[titanic-dataset]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Samarth Malik]]></dc:creator>
            <pubDate>Wed, 10 Apr 2019 20:02:46 GMT</pubDate>
            <atom:updated>2019-04-17T13:09:02.842Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Step by Step Guide for Beginners</em></h4><p>Are you starting your journey in the field of Data Science? Do you need to know how to get started with R? Are you intrigued by Data Visualisations? If yes, then this tutorial is meant for you!</p><h3><strong>Overview &amp; Purpose</strong></h3><p>With this article, we’d learn how to do basic exploratory analysis on a data set, create visualisations and draw inferences.</p><h4><strong>What we’d be covering</strong></h4><ol><li>Getting Started with R</li><li>Understanding your Data Set</li><li>Analysing &amp; Building Visualisations</li></ol><h3><strong>1. Getting Started with R</strong></h3><p><strong>1.1 Download and Install R | R Studio</strong></p><p>R programming offers a set of inbuilt libraries that help build visualisations with minimal code and flexibility.</p><p>You can download R easily from the <a href="https://www.r-project.org/">R Project Website</a>. While downloading you would need to choose a mirror. Choose R depending on your operating system, such as Windows, Mac or Linux.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4AoB5mbvNZ2ojhDV" /></figure><p>It is super easy to install R. Just follow through the basic installation steps and you’d be good to go.</p><p>For an easy way to write scripts, I recommend using <strong>R Studio</strong>. It is an open source environment which is known for its simplicity and efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z_aUOomK2JUga_1P" /><figcaption><strong>Launch Screen after starting R Studio</strong></figcaption></figure><p><strong>1.2 Install R packages</strong></p><p>Packages are the fundamental units created by the community that contains reproducible R code. These include reusable R functions, documentation that describes how to use them and sample data.</p><p>The directory where packages are stored is called the library. R comes with a standard set of packages. Others are available for download and installation. Once installed, they have to be loaded into the session to be used.</p><p>To install a package in R, we simply use the command</p><blockquote><strong>install.packages</strong>(“Name of the Desired Package”)</blockquote><p><strong>1.3 Loading the Data set</strong></p><p>There are some data sets that are already pre-installed in R. Here, we shall be using <strong>The Titanic </strong>data set that comes built-in R in the Titanic Package.</p><p>While using any external data source, we can use the read command to load the files(Excel, CSV, HTML and text files etc.)</p><p>This data set is also available at <a href="https://www.kaggle.com/c/titanic/data">Kaggle</a>. You may download the data set, both train and test files. In this tutorial, we’d be just using the train data set.</p><blockquote>titanic &lt;-<strong> read.csv</strong>(“C:/Users/Desktop/titanic.csv”, header=TRUE, sep=”,”)</blockquote><p>The above code reads the file titanic.csv into a dataframe <strong>titanic</strong>. With Header=TRUE we are specifying that the data includes a header(column names) and sep=”,” specifies that the values in data are comma separated.</p><h3><strong>2. Understanding the Data set</strong></h3><p>We have used the Titanic data set that contains historical records of all the passengers who on-boarded the Titanic. Below is a brief description of the 12 variables in the data set :</p><ul><li>PassengerId: Serial Number</li><li>Survived: Contains binary Values of 0 &amp; 1. Passenger did not survive — 0, Passenger Survived — 1.</li><li>Pclass — Ticket Class | 1st Class, 2nd Class or 3rd Class Ticket</li><li>Name — Name of the passenger</li><li>Sex — Male or Female</li><li>Age — Age in years — Integer</li><li>SibSp — No. of Siblings / Spouses — brothers, sisters and/or husband/wife</li><li>Parch — No. of parents/children — mother/father and/or daughter, son</li><li>Ticket — Serial Number</li><li>Fare — Passenger fare</li><li>Cabin — Cabin Number</li><li>Embarked — Port of Embarkment | C- Cherbourg, Q — Queenstown, S — Southhampton</li></ul><h4><strong>2.1 Peek at your Data</strong></h4><p>Before we begin working on the dataset, let’s have a good look at the raw data.</p><blockquote><em>view(titanic)</em></blockquote><p>This helps us in familiarising with the data set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zweZxQ94CkldWj_lDQYmig.png" /></figure><blockquote><strong>head(titanic,n) | tail(titanic,n)</strong></blockquote><p>In order to have a quick look at the data, we often use the head()/tail().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aeql6_IhQEGHZmLeh42kLA.png" /><figcaption><strong>Top 10 rows of the data set.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lqwe38KBx1qXlMxBnBYuAA.png" /><figcaption><strong>Bottom 5 rows of the data set.</strong></figcaption></figure><p>In case we do not explicitly pass the value for n, it takes the default value of 5, and displays 5 rows.</p><p><strong>names(titanic)</strong></p><p>This helps us in checking out all the variables in the data set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dq-3wd_5PEpZ1AAs6Prv6w.png" /><figcaption><strong>Familiarising with all the Variables/Column Names</strong></figcaption></figure><p><strong>str(titanic)</strong></p><p>This helps in understanding the structure of the data set, data type of each attribute and number of rows and columns present in the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*oRPtKy8XnAL6tN_CjYTEtw.png" /></figure><p><strong>summary(titanic)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zwjAWRwAlCjn9dGApoGO6g.png" /><figcaption>A cursory look at the data</figcaption></figure><p><strong>Summary()</strong> is one of the most important functions that help in summarising each attribute in the dataset. It gives a set of descriptive statistics, depending on the type of variable:</p><ul><li>In case of a Numerical Variable -&gt; Gives Mean, Median, Mode, Range and Quartiles.</li><li>In case of a Factor Variable -&gt; Gives a table with the frequencies.</li><li>In case of Factor + Numerical Variables -&gt; Gives the number of missing values.</li><li>In case of character variables -&gt; Gives the length and the class.</li></ul><p>In case we just need the summary statistic for a particular variable in the dataset, we can use</p><blockquote>summary(datasetName$VariableName) -&gt; summary(titanic$Pclass)</blockquote><p><strong>as.factor(dataset$ColumnName)</strong></p><p>There are times when some of the variables in the data set are factors but might get interpreted as numeric. For example, the Pclass(Passenger Class) tales the values 1, 2 and 3, however, we know that these are not to be considered as numeric, as these are just levels. In order to such variables treated as factors and not as numbers we need explicitly convert them to factors using the function <strong>as.factor()</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*3-aZ_YjJFWHTr9wVukqP6Q.png" /></figure><h3>3. Analysis &amp; Visualisations</h3><p>Data Visualisation is an art of turning data into insights that can be easily interpreted. In this tutorial, we’ll analyse the survival patterns and check for factors that affected the same.</p><p><strong>Points to think about</strong></p><p>Now that we have an understanding of the dataset, and the variables, we need to identify the variables of interest. Domain knowledge and the correlation between variables help in choosing these variables. To keep it simple, we have chosen only 3 such variables, namely Age, Gender, Pclass.</p><p><strong>What was the survival rate?</strong></p><p>When talking about the Titanic data set, the first question that comes up is “How many people did survive?”. Let’s have a simple Bar Graph to demonstrate the same.</p><blockquote><strong>ggplot(titanic, aes(x=Survived)) + geom_bar()</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*HCLykdiI70F-EPKggc6LBA.png" /></figure><p>On the X-axis we have the survived variable, 0 representing the passengers that did not survive, and 1 representing the passengers who survived. The Y -axis represents the number of passengers. Here we see that over 550 passenger did not survive and ~ 340 passengers survived.</p><p>Let’s make is more clear by using checking out the percentages</p><blockquote><strong>prop.table(table(titanic$Survived))</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/309/1*WXLUuMmp705PFUimYXlcbA.png" /></figure><blockquote>Only 38.38% of the passengers who on-boarded the titanic did survive.</blockquote><p><strong>Survival rate basis Gender</strong></p><p>It is believed that in case of rescue operations during disasters, woman’s safety is prioritised. Did the same happen back then?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*7ixtj9_oSaJ3yfi4qWVa6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*rpgtGjA-Nua_Aoi8YI8GQw.png" /></figure><blockquote><em>We see that the survival rate amongst the women was significantly higher when compared to men. The survival ratio amongst women was around 75%, whereas for men it was less than 20%.</em></blockquote><p><strong>Survival Rate basis Class of tickets (Pclass)</strong></p><p>There were 3 segments of passengers, depending upon the class they were travelling in, namely, 1st class, 2nd class and 3rd class. We see that over 50% of the passengers were travelling in the 3rd class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*MPNB_gXTGsnu_l0jXD266Q.png" /><figcaption>Survival Rate basis Passenger Class</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*f_RvYzI0aGi4mmZVuutCTQ.png" /></figure><blockquote>1st and 2nd Class passengers disproportionately survived, with over 60% survival rate of the 1st class passengers, around 45–50% of 2nd class, and less than 25% survival rate of those travelling in 3rd class.</blockquote><p>I’ll leave you at the thought… Was it because of a preferential treatment to the passengers travelling elite<em> </em>class, or the proximity, as the 3rd class compartments were in the lower deck?</p><p><strong>Survival Rate basis Class of tickets and Gender<em>(pclass)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*0p5jzD0OThT6Ea_iiMDsPw.png" /></figure><blockquote><strong>We see that the females in the 1st and 2nd class had a very high survival rate. The survival rate for the females travelling in 1st and 2nd class was 96% and 92% respectively, corresponding to 37% and 16% for men. The survival rate for men travelling 3rd class was less than 15%.</strong></blockquote><p>Till now it is evident that the Gender and Passenger class had significant impact on the survival rates. Let’s now check the impact of passenger’s Age on Survival Rate.</p><p><strong>Survival rates basis age</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*IOAzjaH-K0-eGyvTzh8Oqg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*OPbby9Kk7e3Y9T9PXGgfOA.png" /></figure><blockquote>Looking at the age&lt;10 years section in the graph, we see that the survival rate is high. And the survival rate is low and drops beyond the age of 45.</blockquote><p>Here we have used bin width of 5, you may try out different values and see, how the graph changes.</p><p><strong>Survival Rate basis Age, Gender and Class of tickets</strong></p><p>This graph helps identify the survival patterns considering all the three variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*6sIgm040RWEJlDyluvuU_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*AqgM3ww1d1lb3_ZX4xVSkw.png" /></figure><p>The top 3 sections depict the female survival patterns across the three classes, while the bottom 3 represent the male survival patterns across 3 classes. On the x-axis we have the Age.</p><blockquote>It is evident that the survival rate of children, across 1st and 2nd class was the highest. Except for 1 girl child all children travelling 1st and 2nd class survived. The survival rates were lowest for men travelling 3rd class.</blockquote><p>I hope you found this article helpful. Keep learning, keep growing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=955a7e90f7dd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/data-analysis-and-visualisations-using-r-955a7e90f7dd">Data Analysis and Visualisations using R</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>