Showing posts with label Data analysis. Show all posts
Showing posts with label Data analysis. Show all posts

14 December 2017

Types of Data Analysis

Types of Data Analysis

Analysis involves estimating the values of unknown parameters of the population and testing hypothesis for drawing inferences.

Types of Analysis
a. Qualitative analysis
b. Content analysis
c. Quantitative analysis
d. Descriptive analysis
e. Bivariate analysis
f. Sequential analysis
g. Casual analysis
h. Multivariate analysis
i. Inferential analysis

j. Statistical analysis

Qualitative Analysis
It is less influenced by theoretical assumption. The limitation of this type of analysis is that the findings tend to be unrealisable. The information categories and interpreted after, differ considerable from one investigator to another one. In this system researcher to go through, research cycle, to increase reliability, repeating the research cycle is of value in some ways, but it does not ensure that the findings will have high reliability. Qualitative analyses are carried out in several different kinds of study like
interview, case studies and observational studies.


Content Analysis
Content analysis is used where originally qualitative information is reduced to numerical terms. It is a method of analysis media output includes articles published in new papers, speeches made in radio, television and various type of propaganda. This method of analysis is applied to all most all form of communications.


Quantitative Analysis
The numerical data collected in study through descriptive statistics analysis can be conducted through measure of central tendency.

Descriptive Analysis
This analysis of one variable is called one dimensional analysis. This analysis measures condition at particular time.

Bivariate Analysis
The analysis in respect of two variables is called bivariate analysis. In this analysis collected data in placed into tabular form, so that the meaning of the data can be derived. In this method simple dimensional data is developed and put into two or more categories.


Sequential Analysis
When only factor is revel in the table at one time, this type of analysis is called sequential analysis is called sequential analysis. If we do the further analysis of the same data regard four going showed that person with leave travel concession facilities are more frequently going on tourism than those who are not gating facilities of casual analysis. It is concerned with study of one variable affecting another one.


Multivariate Analysis

With an advancement of computer application there is fast development of multivariate analysis, in which statistical method simultaneously analysis more than two variables.

Inferential Analysis

In order to decide the validity of data to indicate conclusion this analysis is concerned with tests for significance of hypothesis. One the basis of inferential analysis the task of interpretation is performed by estimating the population values.

Subscribe to Sulthan Academy. give your comments and feedback below.

12 December 2017

Important properties of the Normal distribution

clip_image018

The normal distribution was first described by Abraham Demoivre (1667-1754) as the limiting form of binomial model in 1733. Normal distribution was rediscovered by Gauss in 1809 and by Laplace in 1812. Both Gauss and Laplace were led to the distribution by their work on the theory of errors of observations arising in physical measuring processes particularly in astronomy. Here I will show you some important properties of Normal distribution

1. The normal curve is “bell shaped” and symmetrical in nature. The distribution of the frequencies on either side of the maximum ordinate of the curve is similar with each other.

2. The maximum ordinate of the normal curve is atclip_image002. Hence the mean, median and mode of the normal distribution coincide.

3. It ranges between clip_image004 to clip_image006

4. The value of the maximum ordinate is clip_image008

5. The points where the curve change from convex to concave or vice versa is at clip_image010

6. The first and third quartiles are equidistant from median.

7. The area under the normal curve distribution are:

a. clip_image012 covers 68.27% area

b. clip_image014 covers 95.45% area

c. clip_image016 covers 99.73% area

clip_image018

8. When μ = 0 and σ = 1, then the normal distribution will be a standard normal curve. The probability function of standard normal curve is

clip_image020

The following table gives the area under the normal probability curve for some important value of Z.

Distance from the mean ordinate in

Terms of ± σ

Area under the curve

Z = ± 0.6745

0.50

Z = ± 1.0

0.6826

Z = ± 1.96

0.95

Z = ± 2.00

0.9544

Z = ± 2.58

0.99

Z = ± 3.0

0.9973

9. All odd moments are equal to zero.

10. Skewness = 0 and Kurtosis = 3 in normal distribution.

Subscribe Sulthan Academy and give your feedback, suggestions in comment section.

27 November 2017

Multivariate normality Tests with R - Mardia's Test, Henze-Zirkler, Royston

Most multivariate techniques, such as Linear Discriminant Analysis (LDA), Factor Analysis, MANOVA and Multivariate Regression are based on an assumption of multivariate normality. So, In this post, I am going to show you how you can assess the multivariate normality for the variables in your sample. The above test multivariate techniques can be used in a sample only when the variables follow a Multivariate normal distribution.


For this, you need to install a package called MVN Type install.packages("MVN")and then load the package using R command library(“MVN”)

There are 3 different multivariate normality tests available in this package

1.Mardia's Multivariate Normality Test

2.Henze-Zirkler's Multivariate Normality Test

3.Royston's Multivariate Normality Test

Let's discuss these test in brief here, I am using inbuilt trees data here data(“trees”). This data consists of 3 variables I.e Girth, Height and volume.

First, we use Mardia's test to verify the normality for the above data Type mardiaTest(trees) This will return the results of normality test with 3 variables in it. Data is not multivariate normal when the p-value is less than 0.05 .  When you want to check Multivariate normality of selected variables. Create a subset. Let’s create a subset under name trees1 that includes 1st and 3rd variables using the command Trees1<-trees[c(1,3)].

Now let's check normality of trees1 using Henze-Zirkler's Test Type hzTest(trees1) .

To use Royston's Multivariate Normality Test Type roystonTest(trees1). So, That is how you can test the multivariate normality of variables using R. Give your queries and suggestions in comment section below.

Subscribe Sulthan’s Monologue and YouTube channel for more posts and videos. Follow me in twitter @sulthankhan 

24 May 2017

Measurement Scales–Nominal, Ordinal, Interval and Ratio

Measurement scales are classified popularly under four categories:

  1. Nominal,
  2. Ordinal,
  3. Interval,
  4. Ratio.

Let’s discuss in brief about these measurement scales before going on for some technical details. If you want to test Network of 50 smart phone users. Let’s begins by evaluating each on 4G – Non 4G data; this is a nominal measurement. Then the users ranks the Quality from best to worst; this is an ordinal measurement. Next, the mobile users uses a 5 or 7 point scale that has equal distance between points to rate the 4G network with regard to some criterion (e.g., data speed, Coverage, cost and etc.., ); this is an interval measurement. Finally, the user considers another network dimensions (eg.3G) and assigns 100 points among the 50 smart phone users; this is a ratio measurement. The characteristics of these measurement scales are summarized in below table.

Measurement Scales - Sulthan Academy

Note: Likert scale variables falls under Ordinal and/or Interval scale depends on the nature of the measurement.

Subscribe to Sulthan Academy and share my posts with your friends. Leave your queries and feedback in comment section.

Measures of Location–Mean and Median

Measures of location are used in order to determine where the data distribution is concentrated. The most usual measures of location are Mean and Median

Mean

The mean of a set of numerical observations is just the familiar arithmetic average. The sum of the observations divided by the number of observations gives you Arithmetic Mean. It is helpful to have concise notation for the variable on which observations were made.

clip_image002

were

x = the variable for which we have sample data

n = the number of observations in the sample (the sample size)

x1 = the first observation in the sample

x2 = the second observation in the sample

xn = the nth (last) observation in the sample

The Greek letter Ʃ is traditionally used in mathematics to denote summation. It denotes the sum of all the x values in the data set.

Median

Like a median strip of a highway divides the highway in half, the median of a numerical data set does the same thing for a data set. Once the data values have been listed in order from smallest to largest, the median is the middle value in the list, and it divides the list into two equal parts. Depending on whether the sample size n is even or odd, the process of determining the median is slightly different. When n is an odd number (say, 7), the sample median is the single middle value. But when n is even (say, 8), there are two middle values in the ordered list, and we average these two middle values to obtain the sample median.

clip_image004


Subscribe to Sulthan Academy and share my posts with your friends. Leave your queries and feedback in comment section.

22 May 2017

Common symbols used in statistical tests

greek

Each statistical tests or methods has its own terminology and symbols, but the following are commonly used by all statisticians / researchers

N – Size of population

n - number of observations (sample size)

K - number of samples (each having n elements)

α (Alpha) - level of significance

v (Nu)- degrees of freedom

σ (Sigma)- standard deviation (population)

s - standard deviation (sample)

σ2 (Sigma)- Variance(population)

s2 - Variance (sample)

μ (Mu)- population mean

clip_image002 - sample mean

ρ (Rho)- population correlation coefficient

r - sample correlation coefficient

β (beta)- regression coefficients (population)

b - regression coefficients (sample)

Z - standard normal deviate

To understand types of error - WHAT ARE TYPE I AND TYPE II ERRORS?

Subscribe to Sulthan Academy, give your queries and feedback in below comment section.

05 November 2016

Downloading Share prices Method 1 Yahoo Finance to Excel sheet

Youtube thumbnail

This Video explains how to download Share prices from Yahoo Finance to Excel sheet. this is method 1 out of three methods that i will cover in further videos.

Subscribe and share. leave your queries and feedback in comment section. Thank you!

01 November 2016

Rate of Return formula for any asset

10007 Rate of return

 

The actual profit or loss is measured through the returns achieved from particular investments. Let the investment be in Risky securities ( Stocks, Gold, Oil, commodities , ETF, etc..,) or Risk free securities ( Bonds, fixed deposits, etc..,) . The above shown formula is used to understand the level or rate of return achieved. Positive RR shows there is a profit and negative RR refers to a loss.

Example:

Lets assume, Sulthan bought 10 shares of company A @ Rs100 per share on 28.10.2016. On 1.11.2016 the share price of company increase to Rs106. In this example P0 is 100 and P1 is 106. Substituting this in the above RR  formula we get RR is 0.06 . When multiplied by 100 we get 6 which means Sulthan earns 6% profit from his investment.

Leave your queries and feedback in comment section. Subscribe Sulthan academy via email. Share with your friends.

29 October 2016

PSPP : Free alternative for SPSS

pspplogo
Data analysis software SPSS is very popular among social science researchers. It provides various modules for the analysts but the problem is it comes with a big price tag. From Descriptive statistics to complex sampling, bootstrapping, SEM IBM offers pay per person per year plan this means your licence for using the software is valid for just one year and you have to pay for the following year. The product pricing for IBM SPSS is shown here:
SPSS
Not every individual is able to afford SPSS. So, here I suggest a free alternative a open source software PSPP. It has a graphical user interface and conventional command-line interface. It is written in C and uses GNU Scientific Library for its mathematical routines. The name PSPP has "no official acronymic expansion". It is just  P for S and S for P .
This software provides a comprehensive set of capabilities which includes:
  • Frequencies,
  • Cross-tabs comparison of means (t-tests and one-way ANOVA);
  • Linear regression,
  • Logistic regression,
  • Reliability tests (Cronbach's alpha, not failure or Weibull),
  • Non-parametric tests,
  • Factor analysis,
  • Cluster analysis,
  • Principal components analysis,
  • Chi-square analysis and more.
Other benefits of using PSPP are it supports 1 billion cases and variables, Syntax and data files which are compatible with those of SPSS, No license fees, No expiration period.
Where to download?
PSPP is offered under GNU general public licence. You can download the software for Linux, Mac and windows form its official website.
If you have any alternative for SPSS leave it in comment section and Subscribe to I'm Sulthan by Email for more interesting updates.Share with your friends.  Thank you. 

09 September 2016

What are type I and type II errors?

Image by Clker Free Vector Images via Pixabay
Testing  of hypothesis is widespread not only in statistics, but also in the natural and social sciences. When we do a hypothesis test, two types of errors are possible these errors are termed as experimental errors. They are Type-I or Type-II errors. It is important to understand both these effects in order to  manage error and report it, for the right interpretation of conclusion from a experiment.

Decision made
Null Hypothesis is actually
True
False
Reject Null
Type I error
Correct rejection
Fail to reject Null
Correct decision
Type II error
Type I errors occurs when we reject a true null hypothesis - 
The Type I error occurs when a the null hypothesis (H0) is rejected in favor of the research hypothesis (H1), when in reality the 'null' is correct. Type I errors are equivalent to false positives. For example, suppose there is a test that is used to detect a disease in a person. If a Type I error occurs in the test, it means that the test will say the person is suffering from that disease even though he is healthy. Type I errors can be controlled. The value of alpha, which is related to the level of significance that we selected has a direct bearing on type I errors. Alpha is the maximum probability that we have a type I error. For a 95% confidence level, the value of alpha is 0.05. This means that there is a 5% probability that we will reject a true null hypothesis. 
Type II errors happen when we fail to reject a false null hypothesis -
Type II error occurs when we do not reject a null hypothesis that is false. It is equivalent to false negatives.  From the above said example of a medical test for a disease, if a Type-II error occurs, then it means that the test will not detect the disease in the person even though he is actually suffering from it.The probability of a type II error is given by the Greek letter beta. This number is related to the power or sensitivity of the hypothesis test, denoted by 1 – beta.
Ask your queries in comment section and Subscribe to I'm Sulthan by Email for more interesting updates.Share with your friends.  Thank you. Bon voyage !!!

23 February 2016

Simple way to download and export stock data using R - Method 3


you can read the method 1 here: http://www.iamsulthan.in/2016/04/step-by-step-tutorial-to-download.html If you have missed it.

In Security analysis and Portfolio management , the historical prices of a stock or indices is the base data for analysis in that case any researcher want to download and organize the data. Mostly they prefer to save the data in .csv file which is universally imported in any software. A difficulty or time consuming task for such researchers is to organize the data. for example: to check for any missing prices or to organize the closing prices in single worksheet for all companies in case of a multivariate analysis.

Using the following code you can download and export the data to .csv format which can be later used in any other data analysis softwares if you wish whereas R can do almost what other softwares do . It just need proper command to execute your research objectives.



Github link for the code can be located here: download-historical-stock-data-in-R

Use the following code:

========================================================================

####Using quantmod####
####Single Stock data####
if(!require(quantmod)){install.packages("quantmod")}
getSymbols("WIPRO.NS", from="2015-01-01", to= Sys.Date())

#### multiple Stocks data Method-1 (each as seperate dataset) ####
getSymbols("WIPRO.NS;TCS.NS;INFY.NS", from="2015-01-01", to= Sys.Date())

#### multiple Stocks Method-2 (using list)####
stocklist <- c("WIPRO.NS","TCS.NS","INFY.NS","AAPL" )
getSymbols(stocklist, from="2015-01-01", to= Sys.Date())

####multiple Stocks Method-3####
stocklist <- c("WIPRO.NS","TCS.NS","INFY.NS","AAPL") # create list of stock tickers
Adjclose <- NULL
for (Ticker in stocklist)
  Adjclose <- cbind(Adjclose,getSymbols.yahoo(Ticker, from="2015-01-01", to= Sys.Date(), verbose=FALSE, auto.assign=FALSE)[,6]) #get data for companies in list, [,6] = keep the adjusted prices
FinalAdjclose <- na.locf(Adjclose) #copy last traded price in empty cell
FinalAdjclose1 <- Adjclose[apply(Adjclose,1,function(x) all(!is.na(x))),] #keep only dates having closing price
####Export the data to excel####
if(!require(timeSeries)){install.packages("timeSeries")}
data <- as.timeSeries(FinalAdjclose1)
write.csv(data, "data.csv")
========================================================================