Wednesday, October 16, 2013

Getting Started with R ( simple first 5 steps)

Here are a few steps that can get you started with R. This is assuming you have installed R on your computer. If you haven't, download it from here (http://www.r-project.org/).

Before you do anything else, you need to define the working directory for R. By default, R will have its own working directory. It is a good idea to change the working  directory based on the project you are working on.

1. Check the current working directory:
> getwd()

 Change the current working directory:
> setwd(C:\Users\ABC)

Note: Notice the type of slashes used in writing the directory. Using a different slash is a common issue.

2. Load your data file:
1. Although you can load your file in various formats, I would recommend creating a csv file format of your data.
2. Place the file in the working directory. You can place it anywhere else on the computer as well but in that case, you have to enter the full location of the file.

> a = read.csv("file.csv")

This is assigning the name 'a' for your file in R.

3. Get column names:

> names(a)

4. Know the data type (gives you the structure of your dataset):

> str(a)

5. Summary of the dataset:

> summary(a) 

At any point, if you feel the need of knowing more about the command you are using, you can use help in R.
> ?command
e.g. > ?read.csv

Saturday, February 16, 2013

What’s in the name?

We all have filled up online forms at some point in time. These forms, more often than not, are the major component of revenue generation for a website. For a website, you are essentially the product and one way for the website to make money is to sell your information to someone who needs it. E.g. when you fill out a form to get quotes from multiple insurance companies, the website sells your contact information (as a prospective customer) to the insurance agents/companies.

From a customer perspective, the internet has increasingly become the easy-to-get information base for just about everything.  A user looks at multiple websites before he/she reaches out to the vendor/store to make the actual purchase. Google calls it ‘Zero Moment of Truth’.  People want to gather as much information as possible before they take the final decision.

This means that there are hundreds of millions of leads (prospective customers) being generated every year. There just isn’t enough capacity in the industry to deal with all the leads. So the industry runs advanced analytics to filter down the good leads (potential buyer) from the bad ones (window shopper).  This post will discuss the significance of ‘your name’ in deciding whether you will be a good lead or a bad lead.

Case 1

John Smith

john smith

JOHN SMITH

These are three ways of writing down your name. When you type out your name in an online form, you could use only small case, only capital case or a combination of both. The way you type your name gives out a signal to show that you are really interested in buying the actual product or not. A serious buyer, more often than not, will type out his/her name in mixed case (John Smith).

Case 2

Bruce Wayne

Peter Parker

Ronald McDonald

Although all the above names sound like a genuine name but there is a very high probability that you will not be considered as a serious buyer since these names sound fake. For people not familiar with the above names – Bruce Wayne is Batman, Peter Parker is Spiderman and Ronald McDonald is McDonald mascot.

Case 3

Nu Li

A B

Elizabeth Alexander

The number of characters in your name could also play a role in deciding whether you will turn out to be a serious buyer or not.

I don’t want to cite examples for cases where gender, ethnicity or religion can be inferred from the name and hence those can be used to decide your propensity to convert as an actual sale.  Consumers like you and I aren’t aware (or rather we care less) about the implication of every word we type in the internet. Truth is companies track (can track) everything from “what you type” to “when you type” and “how you type” to figure out “who you are and your intentions”.

Disclaimer – The contents of this blog are my personal thoughts and ideas. They do not reflect any position held by any organization. Have any questions? Please message me directly.