Description Usage Arguments Value Author(s) Examples
View source: R/estimate-ideology2.R
estimateIdeology2
estimates ideology for a given user using the
method described in Barbera et al, 2015, Psychological Science. It
projects each user onto a latent ideological space using correspondence
analysis, assuming that all else is constant, and relying on the column
estimates in the paper. The values are then normalized to a N(0,1) distribution.
1 2 | estimateIdeology2(user, friends, verbose = TRUE, exact = FALSE,
replace_outliers = FALSE)
|
user |
screen name of user for which ideology is to be estimated. |
friends |
vector of user IDs that the user for which ideology wants
to be estimated follows. If missing, |
verbose |
logical, default is |
exact |
logical, default is |
replace_outliers |
logical, default is |
The function returns a matrix with summary statistics of the posterior distribution of the two estimated parameters, beta (political interest) and theta (ideology).
Pablo Barbera P.Barbera@lse.ac.uk
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
## Creating OAuth token
my_oauth <- list(consumer_key = "CONSUMER_KEY",
consumer_secret = "CONSUMER_SECRET",
access_token="ACCESS_TOKEN",
access_token_secret = "ACCESS_TOKEN_SECRET")
## download list of friends for a given user
friends <- getFriends(screen_name = "p_barbera", oauth=my_oauth)
## estimating ideology
results <- estimateIdeology2(friends)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.