#
# COMMENTS: BASIC INTRODUCTION TO REGRESSION USING R
#
#
# WILLIAMS P 572 #1
#
# GET DATA
x<-c(1,2,3,4,5)
y<-c(3,7,5,11,14)
# PLOT DATA
plot(x,y)
reg1 <- lm(y~x) # COMPUTE REGRESSION ESTIMATES
summary(reg1) # PRINT OUTPUT
abline(reg1) # PLOT REGRESSION LINE
#
# SCHAUM'S P. 274 #14.2
#
#GET DATA
x<-c(20,16,34,23,27,32,18,22)
y<-c(64,61,84,70,88,92,72,77)
plot(x,y) #PLOT DATA
reg1 <- lm(y~x) # COMPUTE REGRESSION ESTIMATES
summary(reg1) # PRINT OUTPUT
abline(reg1) # PLOT REGRESSION LINE
Sunday, April 25, 2010
Social Network Analysis of Tweets Using R
This past week I attended the AACRAO conference in New Orleans. This provided a great opportunity to demonstrate one of the many things you can do wit R. ( for more about the R statistical programming language see here) R is capable of many outside the box applications (beyond just the basic statistical techniques) such as social network analysis.
The image below represents the network of the last 100 tweets using the hashtag #aacrao10. The data was captured and the network was constructed using R. Thanks to Drew Conway for showing me how to do this.
(Click to enlarge)

Labeled dots indicate users that used the specified hashtag while unlabeled dots indicate 'friends' of users that used the specified hashtag.The code also allows you to compute important network metrics such as measures of centrality that are helpful in key actor analysis.
The image below represents the network of the last 100 tweets using the hashtag #aacrao10. The data was captured and the network was constructed using R. Thanks to Drew Conway for showing me how to do this.
(Click to enlarge)

Labeled dots indicate users that used the specified hashtag while unlabeled dots indicate 'friends' of users that used the specified hashtag.The code also allows you to compute important network metrics such as measures of centrality that are helpful in key actor analysis.
Tuesday, April 6, 2010
Statistics Definitions
SAMPLE POINT- each individual outcome of an experiment
SAMPLE SPACE-the collection of all possible sample points in an experiment
EVENT-a collection of sample points
PRIOR PROBABILITY-initial estimate of the probability of an event
RANDOM VARIABLE-a numerical description of the outcome of an experiment
EXPECTED VALUE OF A RANDOM VARIABLE-a measure of the average value of a random variable
VARIANCE OF A RANDOM VARIABLE-a measure of the dispersion of a random variable
PARAMETER-a numerical measure from a population
STATISTIC- a numerical measure from a sample
SAMPLING DISTRIBUTION-a probability distribution for all possible values of a statistic
PROPERTIES OF ESTIMATORS:
Unbiased: Property of a statistic where the expected value of a statistic/estimator = the parameter being estimated
Consistency: as n increases the probability that the value of a statistic/estimator gets closer to the parameter being estimated increases
Consistency: as n increases the probability that the value of a statistic/estimator gets closer to the parameter being estimated increases
CENTRAL LIMIT THEOREM-the sampling distribution of the sample mean can be approximated by a normal probability distribution as the sample size becomes large. This holds even if the population from which the sample mean comes from is not normal, or unknown.
ASYMPTOTIC DISTRIBUTION- an estimator’s sampling distribution in large samples
ASYMPTOTIC PROPERTIES OF AN ESTIMATOR- properties of an estimator in large samples
Tuesday, March 23, 2010
Distribution Functions (Examples)
Below is a chart that shows a number of possible distribution functions and thier relationships.

Source

Source
Sunday, March 21, 2010
Tuesday, March 9, 2010
Basic Demographics of #AgChat Facebook Group Members
Created using R and ‘members to .csv’ Facebook Ap
March 9, 2010
Breakdown by Gender (Click to Enlarge)

Representation by City and State
Augusta , Illinois
Chicago , Illinois
Indianapolis, Indiana
Hampton , Iowa
Miltonvale, Kansas
Louisville , Kentucky
Caneyville, Kentucky
Frankfort , Kentucky
Winnipeg, Manitoba (Canada)
Saginaw , Michigan
Deckerville, Michigan
Springfield , Missouri
Tecumseh, Oklahoma
Portland, Oregon
Fredrikstad , Ostfold (Norway)
Dallas ,Texas
Selah , Washington
Union West , Virginia
# of Members by State (Click to Enlarge)

Representation By Country (Click to Enlarge)
(Canada, Norway & the U.S.)

Notes:
Note:This data is for demonstration purposes only. There were actually 643 members of the #AgChat Facebook group as of this date, but the ‘members to .csv’ ap limits data retrieval to 499 observations, so this represents only a sampling of actual members. Observations are also omitted for missing values for variables in each respective analysis.For instance, only 24 observations of the available 499 had hometown data listed.
March 9, 2010
Breakdown by Gender (Click to Enlarge)

Representation by City and State
Augusta , Illinois
Chicago , Illinois
Indianapolis, Indiana
Hampton , Iowa
Miltonvale, Kansas
Louisville , Kentucky
Caneyville, Kentucky
Frankfort , Kentucky
Winnipeg, Manitoba (Canada)
Saginaw , Michigan
Deckerville, Michigan
Springfield , Missouri
Tecumseh, Oklahoma
Portland, Oregon
Fredrikstad , Ostfold (Norway)
Dallas ,Texas
Selah , Washington
Union West , Virginia
# of Members by State (Click to Enlarge)

Representation By Country (Click to Enlarge)
(Canada, Norway & the U.S.)

Notes:
Note:This data is for demonstration purposes only. There were actually 643 members of the #AgChat Facebook group as of this date, but the ‘members to .csv’ ap limits data retrieval to 499 observations, so this represents only a sampling of actual members. Observations are also omitted for missing values for variables in each respective analysis.For instance, only 24 observations of the available 499 had hometown data listed.
Subscribe to:
Posts (Atom)
