Todos Logos

48 Followers
5 Blog Followers
Following: 20
Following Blogs: 5

Latest Activity

Implementation of the CDC Growth Charts in R

Todos Logos posted an article on - Sep 17, 2011, 4:44 pm
I implemented in R a function to re-create the CDC Growth Chart, according to the data provided by the CDC. In order to use this function, you need to download the .rar file available at this megaupload link Then unrar the file, and put the Growth folder in your main directory, as selected in R. You...
Comment - Like

R is a cool sound editor!

Todos Logos posted an article on - Sep 7, 2011, 10:43 am
Capabilities of R are definitely unless! After my previous posts about some easy image editing in R (they are here, and here), now is the time to explore if R is capable of sound editing! Just for fun, here I created a function that receives a phone number (or another sequence of numbers), and retur...
Comment - Like

R is a cool image editor #2: Dithering algorithms

Todos Logos posted an article on - Aug 29, 2011, 5:11 am
Here I implemented in R some dithering algorithms: - Floyd-Steinberg dithering - Bill Atkinson dithering - Jarvis-Judice-Ninke dithering - Sierra 2-4a dithering - Stucki dithering - Burkes dithering - Sierra2 dithering - Sierra3 dithering For each algorit...
Comment - Like

Benford's law, or the First-digit law

Todos Logos posted an article on - Aug 25, 2011, 5:30 pm
Benford's law, also called the first-digit law, states that in lists of numbers from many (but not all) real-life sources of data, the leading digit is distributed in a specific, non-uniform way. According to this law, the first digit is 1 about 30% of the time, and larger digits occur as the leadin...
Comment - Like

How to plot points, regression line and residuals

Todos Logos posted an article on - Jun 16, 2011, 3:52 am
x y # plot scatterplot and the regression line mod1 plot(x, y, xlim=c(min(x)-5, max(x)+5), ylim=c(min(y)-10, max(y)+10)) abline(mod1, lwd=2) # calculate residuals and predicted values res pre # plot distances between points and the regression line segments(x, y, x, pre, col="red") # add labels (r...
Comment - Like

R is a cool image editor!

Todos Logos posted an article on - Nov 7, 2010, 5:40 am
Here I present some functions I wrote to recreate some of the most common image effect available in all image editor. They require the library rimage. To load the image, use: y read.jpeg("path") To display the image, use: plot(y) Original image Sepia tone rgb2sepia function(img){ iRed img[,,1]...
Comment - Like

Fast matrix inversion

Todos Logos posted an article on - Oct 19, 2010, 2:13 pm
Very similar to what has been done to create a function to perform fast multiplication of large matrices using the Strassen algorithm (see previous post), now we write the functions to quickly calculate the inverse of a matrix. To avoid rewriting pages and pages of comments and formulas, as I did fo...
Comment - Like

Fast matrix multiplication in R: Strassen's algorithm

Todos Logos posted an article on - Oct 18, 2010, 9:31 am
I tried to implement the Strassen's algorithm for big matrices multiplication in R. Here I present a pdf with some theory element, some example and a possible solution in R. I'm not a programmer, so the function is not optimize, but it works. I want to thank G. Grothendieck: suggested me a very nice...
Comment - Like

Convert decimal to IEEE-754 in R

Todos Logos posted an article on - Oct 6, 2010, 6:47 am
For some theory on the standard IEEE-754, you can read the Wikipedia page. Here I will post only the code of the function to make the conversion in R. First we write some functions to convert decimal numbers to binary numbers: decInt_to_8bit q r xx for(i in 1:precs){ xx[1] q[i] r[i] xx[i+1] } rr r...
Comment - Like

Bhapkar V test

Todos Logos posted an article on - Apr 28, 2010, 12:22 pm
This is the code to perform the Bhapkar V test. I've rapidly wrote it, in 2 hours. The code is then quite brutal and it could be done better. As soon as possible, I will correct it. WARNING: it works *ONLY* with 3 groups, for now! bhapkar.test.3g sample for(i in 1:length(data1)){ sample } obs for(...
Comment - Like

Latin squares design in R

Todos Logos posted an article on - Jan 6, 2010, 7:21 am
The Latin square design is used where the researcher desires to control the variation in an experiment that is related to rows and columns in the field. Remember that: * Treatments are assigned at random within rows and columns, with each treatment once per row and once per column. * There a...
Comment - Like

Polynomial regression techniques

Todos Logos posted an article on - Sep 5, 2009, 2:26 pm
Suppose we want to create a polynomial that can approximate better the following dataset on the population of a certain Italian city over 10 years. The table summarizes the data: $$\begin{tabular}{|1|1|}\hline Year & Population\\ \hline 1959&4835\\ 1960&4970\\ 1961&5085\\ 1962&5160\\ 1963&5310\\ 196...
Comment - Like

Web-site trend analysis with data from Google Analytics

Todos Logos posted an article on - Aug 25, 2009, 2:44 pm
This post is a summary of my two previous posts on the trend analysis with the Cox-Stuart test and on simple linear regression. The goal that we propose is to assess the trend in the number of visits received from a site over a long time. I use Google Analytics, because this tool allows us to save t...
Comment - Like

Simple logistic regression on qualitative dichotomic variables

Todos Logos posted an article on - Aug 20, 2009, 6:43 am
In this post we will see briefly how to implement a logistic regression model if you have categorical variables, or qualitative, organized in double entry contingency tables. In this model the dependent variable (Y) and independent variable (X) are both dichotomies (or Bernoullian). In general, the ...
Comment - Like
Todos Logos is following Himalay H.

Trend Analysis with the Cox-Stuart test in R

Todos Logos posted an article on - Aug 8, 2009, 3:59 am
The Cox-Stuart test is defined as a little powerful test (power equal to 0.78), but very robust for the trend analysis. It is therefore applicable to a wide variety of situations, to get an idea of the evolution of values obtained. The proposed method is based on the binomial distribution. In R ther...
Comment - Like

Two-way analysis of variance: two-way ANOVA in R

Todos Logos posted an article on - Aug 7, 2009, 2:28 pm
The one-way analysis of variance is a useful technique to verify if the means of more groups are equals. But this analysis may not be very useful for more complex problems. For example, it may be necessary to take into account two factors of variability to determine if the averages between the group...
Comment - Like

Simple linear regression

Todos Logos posted an article on - Aug 6, 2009, 1:30 am
We use the regression analysis when, from the data sample, we want to derive a statistical model that predicts the values of a variable (Y, dependent) from the values of another variable (X, independent). The linear regression, which is the simplest and most frequent relationship between two quantit...
Comment - Like

Contingency table and the study of the correlation between qualitative variables: Pearson's Chi-squared test

Todos Logos posted an article on - Aug 5, 2009, 1:30 am
If you have qualitative variable, it is possible to verify the correlation by studying a contingency table R by C, using the Pearson's Chi-squared test. A casino wants to study the correlation between the modes of play and the number of winners by age group, to see if the number of winners depends o...
Comment - Like

Non-parametric methods for the study of the correlation: Spearman's rank correlation coefficient and Kendall tau rank correlation coefficient

Todos Logos posted an article on - Aug 4, 2009, 1:30 am
We saw in the previous post, how to study the correlation between variables that follow a Gaussian distribution with the Pearson product-moment correlation coefficient. If it is not possible to assume that the values follow gaussian distributions, we have two non-parametric methods: the Spearman's ...
Comment - Like

Parametric method for the study of the correlation: the Pearson r-test

Todos Logos posted an article on - Aug 3, 2009, 3:33 am
Suppose you want to study whether there is a correlation between 2 sets of data. To do this we compute the Pearson product-moment correlation coefficient, which is a measure of the correlation (linear dependence) between two variables X and Y; then we compute the value of a t-test to study the signi...
Comment - Like

About Me

Italian student 23yo ;)

Todos Logos's Blogs:

Todos Logos's Followers

Todos Logos is Following

Invite Your Friends

Invite your contacts to blogged from:
gmail yahoo