<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SOISOS</title>
	<atom:link href="http://www.soisos.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.soisos.com</link>
	<description>The Essential Ingredient I cannot live without ...</description>
	<lastBuildDate>Tue, 25 Oct 2011 17:54:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Characteristics of Distributions</title>
		<link>http://www.soisos.com/archives/205</link>
		<comments>http://www.soisos.com/archives/205#comments</comments>
		<pubDate>Fri, 01 Apr 2011 21:08:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[distribution]]></category>
		<category><![CDATA[poisson]]></category>

		<guid isPermaLink="false">http://www.soisos.com/?p=205</guid>
		<description><![CDATA[Poisson Distribution Sum of independent poission random variables is also Poison with mean = sum of the means of the random variables.]]></description>
			<content:encoded><![CDATA[<p><strong>Poisson Distribution</strong><br />
Sum of independent poission random variables is also Poison with mean = sum of the means of the random variables. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.soisos.com/archives/205/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logistic Regression and How to interpret it</title>
		<link>http://www.soisos.com/archives/171</link>
		<comments>http://www.soisos.com/archives/171#comments</comments>
		<pubDate>Fri, 21 Jan 2011 03:58:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[logistic]]></category>
		<category><![CDATA[logit]]></category>
		<category><![CDATA[multiple logistic]]></category>
		<category><![CDATA[regression]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.soisos.com/?p=171</guid>
		<description><![CDATA[When to use Simple Logistic Regression Logistic regression is used when Yi, response variable is binary, 0 or 1. Meaning of Response Function of binary response var Yi = beta_0 + beta_1* Xi + ei Considering Yi as bernoulli random variable, P(Yi =1 ) = pi ** let&#8217;s say probability of success P(Yi = 0 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>When to use Simple Logistic Regression</strong></p>
<p>Logistic regression is used when Yi, response variable is binary, 0 or 1.</p>
<p>Meaning of Response Function of binary response var<br />
Yi = beta_0 + beta_1* Xi + ei</p>
<p>Considering Yi as bernoulli random variable,<br />
P(Yi =1 ) = pi   ** let&#8217;s say probability of success<br />
P(Yi = 0 ) = 1-pi  ** probability of failure<br />
E(Yi) = 1(pi) + 0(1-pi) = pi which equals P(Yi=1)<br />
Therefore, we can say Expected value of Yi is same as probability of Yi being 1. (p of success)</p>
<p>Problems with binary response variables are:<br />
1.  error term can only take two values<br />
2.  variance is dependent of Xs</p>
<p><strong>How to run logistic regression in R</strong><br />
<code><br />
#upload data<br />
dat1<-read.table(dat1.txt, sep='\t', header=T)<br />
test.logr<-glm( result~gender, family=binomial(logit))<br />
</code><br />
Let Yi=1 success and Yi=0 failure and<br />
Let probability of success (p(Yi=1)) be 0.2 and probability of failure (p(Yi=0) be 0.8.<br />
The odds of success is p/(1-p) = 0.2/0.8 =0.25  is 1 to 4</p>
<p>Basically logit is transforming the odds function using log<br />
log(p/(1-p)) .  It's monotonic transformation and it can ease the problem of restricted range.</p>
<p>So how does logit look like?<br />
logit(p) = log(p/(1-p)) = b0 + b1X1 + ... bkXk<br />
p = exp(b0+b1x1 + bkxk)/(1+exp(b0+b1x1 + ... + bkxk)</p>
<p><strong>How to Interpret coefficients?</strong></p>
<p>logit(p) = b0 + b1(school),</p>
<p>where school (public =1 and private =0)</p>
<p>success = 0,  failure = 1<br />
private = 0 , public =1</p>
<p>b0 is log odds for public since we coded private =0 (baseline)<br />
b1 = log(1.325)  = Odds ratio of private to public</p>
<p>Let coefficients be b1 = 0.5234 and b0 = -1.23<br />
How to interpret the coefficients?</p>
<p>By exponentiating b1 (that is log(1.325)), odds ratio may be calculated and it can interpreted  as:</p>
<p>Odds for private school being successful are 33%  than odds for public school.</p>
<p>To check, you can simply compute odds for public school and private school, then log the ratio log(1.325) then you will get b1 value.</p>
<p><strong>Multiple Logistic Regression Model</strong></p>
<p>It can be interpreted just like a simple logistic regression.  But you interpret it as assuming that all other predictor variables are held constant.</p>
<p>With coefficients, you may compute odds ratio and can be worded as follows:<br />
the odds of a student being successful increase by xx percent with each additional year of tutoring (X1) for given soceioeconomic status and location.<br />
the odds of a student being successful in area 1 is at most 7 time as as great as for a student<br />
 in area 2.  where area1 = 1 and area2 coded as 0</p>
<p>http://division.aomonline.org/rm/1997_forum_regression_models.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.soisos.com/archives/171/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Fav Pizza dough recipe</title>
		<link>http://www.soisos.com/archives/149</link>
		<comments>http://www.soisos.com/archives/149#comments</comments>
		<pubDate>Tue, 28 Dec 2010 07:39:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Other Interests]]></category>
		<category><![CDATA[dough]]></category>
		<category><![CDATA[pizza]]></category>
		<category><![CDATA[thin crust]]></category>

		<guid isPermaLink="false">http://www.soisos.com/?p=149</guid>
		<description><![CDATA[Thin Pizza Dough (wolfgang puck style) (source: http://www.grouprecipes.com/46552/italian-thin-crust-pizza-dough.html) Ingredients 1 package active dry yeast 1 teaspoon honey 1 cup warm water (105 to 115 F) 3 cups of all-purpose flour 1 teaspoon salt 1 tablespoon extra-virgin olive oil How to cook it Dissolve the yeast and honey in 1/4 cup warm water. Combine the flour [...]]]></description>
			<content:encoded><![CDATA[<h3>Thin Pizza Dough (wolfgang puck style)</h3>
<p>(source: <a href="http://www.grouprecipes.com/46552/italian-thin-crust-pizza-dough.html">http://www.grouprecipes.com/46552/italian-thin-crust-pizza-dough.html</a>)</p>
<h4>Ingredients</h4>
<p>1 package active dry yeast<br />
1 teaspoon honey<br />
1 cup warm water (105 to 115 F)<br />
3 cups of all-purpose flour<br />
1 teaspoon salt<br />
1 tablespoon extra-virgin olive oil</p>
<h4>How to cook it</h4>
<p>Dissolve the yeast and honey in 1/4 cup warm water.</p>
<p>Combine the flour and the salt. Add the oil, the yeast mixture, and the remaining 3/4 cup of water.</p>
<p>Mix until the entire mixture forms a ball.</p>
<p>Turn the dough out onto a lightly floured surface.<br />
Knead by hand 2 or 3 minutes. The dough should be smooth and firm.</p>
<p>Cover the dough with a clean, damp towel and let it rise in a cool spot for about 2 hours. (When ready, the dough will stretch as it is lightly pulled).</p>
<p>Divide the dough into 2 balls. *Alternatively you could divide into 4 balls to make into 4 pizzas, about 6 ounces each, to make 8 inch pizzas.</p>
<p>Work each ball by pulling down the sides and tucking under the bottom of the ball. Repeat 4 or 5 times. Then on a smooth, unfloured surface, roll the ball under the palm of your hand until the top of the dough is smooth and firm, about 1 minutes. Cover the dough with a damp towel and let rest 1 hour. *At this point, the balls can be wrapped in plastic and refrigerated for up to 2 days.</p>
<p>Preheat oven to 500 F or highest temp. Lightly oil cookie sheet with extra-virgin olive oil. Roll out dough ball, on a lightly floured surface, to the shape of your cookie sheet. Carefully transfer dough to cookie sheet, lightly press and stretch out to the edges of sheet.</p>
<p>Add sauce (not too much) and toppings. Start with sauce, then cheese, veggies and meat.</p>
<p>Cook for 10 &#8211; 12 minutes, more depending on the thickness of crust due to size of pan you used.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.soisos.com/archives/149/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plotting density in R</title>
		<link>http://www.soisos.com/archives/138</link>
		<comments>http://www.soisos.com/archives/138#comments</comments>
		<pubDate>Wed, 13 Oct 2010 20:26:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[cex]]></category>
		<category><![CDATA[graphic]]></category>
		<category><![CDATA[plot]]></category>
		<category><![CDATA[r]]></category>
		<category><![CDATA[stat]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.soisos.com/?p=138</guid>
		<description><![CDATA[How to plot density plot(density(DATA)) Rainbow color in R If you want to make a plot have rainbow color range, you can use rainbow function: rcol=rainbow(length(YOURDATA)) plot(DATAX, DATAY, type=&#8221;l&#8221;) points(DATAX, DATAY, pch=16, col=rcol) Simple Plot How to change the size of text in a plot? Use argument cex.[attribute] , and examples are below: main titles [...]]]></description>
			<content:encoded><![CDATA[<p><strong>How to plot density</strong><br />
plot(density(DATA))</p>
<p><strong>Rainbow color in R</strong><br />
If you want to make a plot have rainbow color range, you can use rainbow function:</p>
<p> rcol=rainbow(length(YOURDATA))<br />
 plot(DATAX, DATAY, type=&#8221;l&#8221;)<br />
 points(DATAX, DATAY, pch=16, col=rcol)</p>
<p><strong>Simple Plot</strong></p>
<p>How to change the size of text in a plot?<br />
Use argument cex.[attribute] , and examples are below:</p>
<p>main titles by cex.main<br />
sub titles by cex.sub<br />
axis annonation by cex.axis<br />
xlab and ylab by cex.lab</p>
<p>Legend<br />
legend(x, y = NULL, legend, fill = NULL, col = par(&#8220;col&#8221;),<br />
       border=&#8221;black&#8221;, lty, lwd, pch,<br />
       angle = 45, density = NULL, bty = &#8220;o&#8221;, bg = par(&#8220;bg&#8221;),<br />
       box.lwd = par(&#8220;lwd&#8221;), box.lty = par(&#8220;lty&#8221;), box.col = par(&#8220;fg&#8221;),<br />
       pt.bg = NA, cex = 1, pt.cex = cex, pt.lwd = lwd,<br />
       xjust = 0, yjust = 1, x.intersp = 1, y.intersp = 1,<br />
       adj = c(0, 0.5), text.width = NULL, text.col = par(&#8220;col&#8221;),<br />
       merge = do.lines &#038;&#038; has.pch, trace = FALSE,<br />
       plot = TRUE, ncol = 1, horiz = FALSE, title = NULL,<br />
       inset = 0, xpd, title.col = text.col, title.adj = 0.5)</p>
<p><a href="http://www.soisos.com/wp-content/uploads/2010/10/r_symbol.jpg"><img src="http://www.soisos.com/wp-content/uploads/2010/10/r_symbol-300x297.jpg" alt="symbols for R" title="r_symbol" width="300" height="297" class="alignnone size-medium wp-image-142" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.soisos.com/archives/138/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful R syntax</title>
		<link>http://www.soisos.com/archives/116</link>
		<comments>http://www.soisos.com/archives/116#comments</comments>
		<pubDate>Wed, 13 Oct 2010 07:32:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Statistics]]></category>

		<guid isPermaLink="false">http://www.soisos.com/?p=116</guid>
		<description><![CDATA[Reading table of selected file from a broswer read.table(file.choose()) nrow (dat) # number of rows head (dat) # shows names and first few rows of dat paste(&#8220;hello&#8221;, &#8220;world&#8221;, sep=&#8221;-&#8221;) # hello-world source(mylibrary.R) # will import mylibrary content rep(NA, 5) # NA NA NA NA NA rep(1:4, 2) # 1 2 3 4 1 2 3 [...]]]></description>
			<content:encoded><![CDATA[<h3>Reading table of selected file from a broswer</h3>
<p><code>read.table(file.choose())</code></p>
<p>nrow (dat)  # number of rows<br />
head (dat) # shows names and first few rows of dat<br />
paste(&#8220;hello&#8221;, &#8220;world&#8221;, sep=&#8221;-&#8221;) # hello-world</p>
<p>source(mylibrary.R) # will import mylibrary content</p>
<p>rep(NA, 5) # NA NA NA NA NA<br />
rep(1:4, 2) # 1 2 3 4 1 2 3 4<br />
rep(1:4, each=2) # 1 1 2 2 3 3 4 4<br />
Validating assumption of multivariate normal data</p>
<p>Univariate diagnostic plots : Histogram and QQ plot</p>
<p>Standardize the data and plot a histogram<br />
mydata.st<-scale(mydata.dat)<br />
hist(mydata.st, main="histgram", xlab="X values")</p>
<p>#qq plot</p>
<p>## pch =16  (16 is a symbol for a filled circle)<br />
qqnorm(mydata.st, main="QQ plot", pch=16, col="navy")</p>
<p>Chi-squre plot</p>
<p>==========<br />
Output multiple plots in one screen (page)</p>
<p>## c(2,3) determines no of rows and columns<br />
## no of row = 2<br />
## no of columns = 3<br />
par(mfrow=c(2,3))</p>
<p>Parameters for graphs<br />
Pch : plotting character, i.e., symbol to use<br />
there are 18 symbols.</p>
<p>============<br />
Random variable generator in R<br />
# Standard normal<br />
# n: number of values you want to generate<br />
rnorm(n)</p>
<p># Chi-square<br />
# n: no of values, df: degrees of freedom<br />
rchisq(n, df)</p>
<p># Cauchy<br />
# n: no of values<br />
rcauchy(n)</p>
<p><strong>Create a Matrix in R</strong></p>
<p>	yes no  maybe<br />
apple   1    4    7<br />
orange  2   5    8<br />
banana   3  6    9</p>
<p><code>Evac <- matrix(c(1,2,3,4,5,6,7,8,9), 3, 3, dimnames=list(fruit=c("apple", "orange", "banana"), answer=c("yes", "no", "maybe")))</code></p>
<p><strong> Perform Fishers Exact Test in R</strong><br />
<code>fisher.test(Evac)</code></p>
<p><strong>Manipulating data frame and data</strong><br />
When reading a large set of data, it is better to scan than loading the whole data set.</p>
<h3>Using linux command in R is a good way to save processing time</h3>
<p><strong>grep </strong><br />
string function that returns indices of your interest</p>
<p>#print working directory path<br />
getwd()</p>
<p>#set working directory path<br />
setwd("C://...")</p>
<p># installing packages<br />
install.packages(package_name)</p>
<p># print files and dir in the working dir<br />
list.files()</p>
<p># Lower and Uppercase<br />
toupper # to uppercase<br />
tolower # to lowercase</p>
]]></content:encoded>
			<wfw:commentRss>http://www.soisos.com/archives/116/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>calculus for statistics</title>
		<link>http://www.soisos.com/archives/125</link>
		<comments>http://www.soisos.com/archives/125#comments</comments>
		<pubDate>Fri, 27 Aug 2010 20:01:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Statistics]]></category>

		<guid isPermaLink="false">http://www.soisos.com/?p=125</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.soisos.com/wp-content/uploads/2010/08/midterm_eq4.gif" alt="" title="midterm_eq" width="159" height="68" class="alignnone size-full wp-image-134" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.soisos.com/archives/125/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manipulating data frame/table</title>
		<link>http://www.soisos.com/archives/114</link>
		<comments>http://www.soisos.com/archives/114#comments</comments>
		<pubDate>Fri, 20 Aug 2010 20:14:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[data frame]]></category>
		<category><![CDATA[eliminate]]></category>
		<category><![CDATA[r]]></category>
		<category><![CDATA[r code]]></category>
		<category><![CDATA[stat]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.soisos.com/?p=114</guid>
		<description><![CDATA[To eliminate rows with condition # eliminate rows that Age is empty dat]]></description>
			<content:encoded><![CDATA[<p>To eliminate rows with condition<br />
<code><br />
# eliminate rows that Age is empty<br />
 dat<-dat[-which(temp$Age==""),]</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.soisos.com/archives/114/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>r error:  FEXACT error 7</title>
		<link>http://www.soisos.com/archives/107</link>
		<comments>http://www.soisos.com/archives/107#comments</comments>
		<pubDate>Fri, 20 Aug 2010 19:31:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[chi-square]]></category>
		<category><![CDATA[contingency]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[FEXACT error 7]]></category>
		<category><![CDATA[fisher]]></category>
		<category><![CDATA[fisher's exact test]]></category>
		<category><![CDATA[r]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[too small]]></category>

		<guid isPermaLink="false">http://www.soisos.com/?p=107</guid>
		<description><![CDATA[R Error: FEXACT error 7 Testing with small sample size, it is more preferable to use the Fisher&#8217;s Exact test than the Chi-square test. fisher.test(counts, simulate.p.value=TRUE) If you have too many rows or columns, you may get an error saying, FEXACT error 7. LDSTP is too small for this problem. Try increasing the size of [...]]]></description>
			<content:encoded><![CDATA[<p>R Error: FEXACT error 7</p>
<p>Testing with small sample size, it is more preferable to use the Fisher&#8217;s Exact test than the Chi-square test.<br />
<code>fisher.test(counts, simulate.p.value=TRUE)</code></p>
<p>If you have too many rows or columns, you may get an error saying,<br />
<code>FEXACT error 7.<br />
LDSTP is too small for this problem.<br />
Try increasing the size of the workspace.</code></p>
<p>You can still do the test by adding &#8220;simulate.p.value=TRUE&#8221;<br />
<code>fisher.test(counts, simulate.p.value=TRUE)</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.soisos.com/archives/107/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Contingency Table for Categorical data and R</title>
		<link>http://www.soisos.com/archives/101</link>
		<comments>http://www.soisos.com/archives/101#comments</comments>
		<pubDate>Wed, 11 Aug 2010 02:03:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[anova]]></category>
		<category><![CDATA[categorical data]]></category>
		<category><![CDATA[contingency]]></category>
		<category><![CDATA[contingency table]]></category>
		<category><![CDATA[multivariate]]></category>
		<category><![CDATA[r]]></category>
		<category><![CDATA[r code]]></category>
		<category><![CDATA[stat]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.soisos.com/?p=101</guid>
		<description><![CDATA[How to create contingency table from categorical data in r. Example: There are three categorical variables x1, x2, x3 measured from wild cats where x1 = gender (male, female) x2 = age (young, kitten, adult) x3 = test result ( positive = 1, negative =0). r table will generate two tables: 2by2 table for each [...]]]></description>
			<content:encoded><![CDATA[<p>How to create contingency table from categorical data in r.</p>
<p>Example:<br />
There are three categorical variables x1, x2, x3 measured from wild cats where<br />
x1 = gender (male, female)<br />
x2 = age (young, kitten, adult)<br />
x3 = test result ( positive = 1, negative =0).</p>
<p>r table will generate two tables:   2by2 table for each of  x3=0 and x3=1.</p>
<p><code># r code<br />
table(x1, x2, x3)</code></p>
<p>As shown below, the R output has two parts when x3=0 and x3=1.<br />
Row represents Gender (x1) and the column represents Age (x2).<br />
The numbers are counts of cats that fall into the corresponding categories.</p>
<p><code>, ,  = 0</code></p>
<p><code><br />
        A   K  Y<br />
  F   14  84  2<br />
  M  8    97  2</code></p>
<p><code>, ,  = 1</code></p>
<p><code><br />
        A  K  Y<br />
  F   1  12  0<br />
  M  1  36  0 </code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.soisos.com/archives/101/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>T value, F value, Z value in R</title>
		<link>http://www.soisos.com/archives/70</link>
		<comments>http://www.soisos.com/archives/70#comments</comments>
		<pubDate>Tue, 03 Aug 2010 20:20:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Statistics]]></category>

		<guid isPermaLink="false">http://www.soisos.com/?p=70</guid>
		<description><![CDATA[T values t value = qt(alpha/2, n-1) #example > qt(0.975, 8 ) [1] 2.306004]]></description>
			<content:encoded><![CDATA[<p>T values </p>
<p><code>t value = qt(alpha/2, n-1) </code></p>
<p><code>#example </code><br />
<code>> qt(0.975, 8 )</code><br />
<code>[1] 2.306004</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.soisos.com/archives/70/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

