Saturday, 30 March 2013

RLab_Session10


3D PLOTTING


Assignment 1:

Create 3 vectors, x, y, z and choose any random values for them, ensuring they are of equal length, bind them together.Create 3 dimensional plots of the same.

Data Set Creation Commands and DataSet :



Plotting 3D plot:

Normal Plot:   plot3d(T[, 1:3])




Colour Plot: plot3d(T[, 1:3], col = rainbow(1000))


Color Plot of spheres:  plot3d(T[, 1:3], col = rainbow(1000), type = 's')



Assignment 2:

Choose 2 random variables 
Create 3 plots: 
1. X-Y 
2. X-Y|Z (introducing a variable z and cbind it to z and y with 5 diff categories)
3. Color code and draw the graph 
4. Smooth and best fit line for the curve


Data set creation for two random variables and then introducing third variable z




Plots:

>qplot(x,y)


>qplot(x,z)


Semi-transparent plot

> qplot(x,z, alpha=I(2/10))


Colour plot

> qplot(x,y, color=z)


Logarithmic colour plot

> qplot(log(x),log(y), color=z)


Best Fit and Smooth curve using "geom"

> qplot(x,y,geom=c("path","smooth"))

> qplot(x,y,geom=c("point","smooth"))



> qplot(x,y,geom=c("boxplot","jitter"))





Saturday, 23 March 2013

ITBA lab Session # 9 - 19 March 2013

# this post is created as a solution for assignment for IT & Business Applications Lab, Spring Semester, VGSoM, IIT Kharagpur Class of 2014.


I am a marketing enthusiast and love to browse on social networking sites. Being in my first year, I am trying to build my resume as strong as possible to derive the best out of it and get into a good job. Since I am aiming a job in marketing, I need something innovative, not only in the contents of my resume but also, in the way I present it. I tried to find out some good open source software that can help me do it.

In my last session of ITBAL, to my luck, my Professor introduced me to one such software and gave me some knowledge on data visualization. 

First, let us know what data visualization is all about. 

Data visualization is the study of the visual representation of data, meaning "information that has been abstracted in some schematic form, including attributes or variables for the units of information".

According to Friedman (2008) the "main goal of data visualization is to communicate information clearly and effectively through graphical means.

It doesn't mean that data visualization needs to look boring to be functional or extremely sophisticated to look beautiful. To convey ideas effectively, both aesthetic form and functionality need to go hand in hand, providing insights into a rather sparse and complex data set by communicating its key-aspects in a more intuitive way. Yet designers often fail to achieve a balance between form and function, creating gorgeous data visualizations which fail to serve their main purpose — to communicate information".


The tool that I used for developing my resume implementing data visualization is visual.ly .


Tool Analysis :  Visual.ly: (http://visual.ly/)

About:

Visual.ly is a community platform for data visualization and infographics. It was founded by Stew Langille, Lee Sherman, Tal Siach, and Adam Breckler in 2011.

Visual.ly is structured as both as a showcase for infographics as well as a marketplace and community for publishers, designers, and researchers. The site allows users to search images through description, tags, and sources in a variety of categories, ranging from Education to Business or Politics.Users can publish infographics to their personal profile, which they can subsequently share through their social networks.

Visual.ly maintains a team of data analysts, journalists, and designers that create infographics and data visualizations using the Visual.ly tools. They are currently developing a tool that allows anyone to create and publish their own data visualizations.Through this tool, users will be able to gather information from databases and APIs in an automated service to produce an infographic. 

By tapping into Visually's vibrant community of more than 35,000 designers, Marketplace is able to match infographic commissioners – brands, companies, agencies – with designers, Once matched, commissioners have direct access to the designers working on their projects and can communicate and transact with them in Visually's Project Center. Through such unique features as the Project Timeline, commissioners always know where their project stands and can ensure that it stays on time and on budget.

Visually partners with the world's leading publications and brands, bringing  tools, community, and talented team to bear data visualization needs, wherever bespoke creation is needed.


Some points that I found were wonderful about this tool were:

  • UI is very user friendly
  • it is open source
  • numerous options regarding visual presentation of different types of data are available
  • the full tool is available online and it is not necessary to install any software on your PC
  • it is fast
  • the results are attractive and elegant
  • themes and options suiting everyone's style and taste are available.
  • once the visual presentation of data is ready, all possible options to retain and avail that data are available.
Here is the picture of my resume, hope you will like it.......




I was amazed to see how easily this tool created such an image for me to use.
I wanted to explore this tool further.

Since I have already mentioned above, I am an active user of Facebook, so, I decided to play with my profile as well. Just wanted to see what turned out. 

So, I used "Your Complex Facebook tale by Amstel", one of the many templates available on http://create.visual.ly/ . I was happy to see what turned out....






Friday, 15 March 2013

Session 8 - R Lab

Assignment 8 : Panel Data Analysis

Do Panel Data Analysis of "Produc" data analyzing  on three types of model :

  •       Pooled affect model
  •       Fixed affect model
  •       Random affect model


Determine which model is the best by using functions:

  •        pFtest : Fixed vs Pooled
  •        plmtest : Pooled vs Random
  •        phtest: Random vs Fixed



 Pooled Model

Command:
pool<-plm( log(pcap) ~ log(hwy) +  log(water) + log(util) + log(pc) + log(gsp) + log(emp) + log(unemp)
, data= Produc, model = ("pooling"), index = c("state","year"))




 Fixed Model

Command:
fixed<-plm( log(pcap) ~ log(hwy) +  log(water) + log(util) + log(pc) + log(gsp) + log(emp) + log(unemp)
, data= Produc, model = ("within"), index = c("state","year"))





Random Model

Command:
random<-plm( log(pcap) ~ log(hwy) +  log(water) + log(util) + log(pc) + log(gsp) + log(emp) + log(unemp)
, data= Produc, model = ("random"), index = c("state","year"))


Pooled vs Fixed 

Null Hypothesis: Pooled Model
Alternate Hypothesis : Fixed Model



Pooled vs Random 

Null Hypothesis: Pooled Model
Alternate Hypothesis: Random Model

Since the p value is negligible so we reject the Null Hypothesis and hence Alternate hypothesis is accepted which is to accept Random Model is better than Pooled Model


Conclusion: 

So after making all the comparisons we come to the conclusion that Fixed Model is best suited to do the panel data analysis for "Produc" data set.
Hence , we conclude that within the same id i.e. within same "state" there is no variation.