Displaying 20 results from an estimated 100 matches similar to: "how to control the naming of factors in regression"
2010 Apr 30
6
addListener
I am trying to use the marker method addlistener(). A simplified version
of what I''m trying to do:
var map;
var marker;
map = new mxn.Mapstraction(''myMap'',''google'');
map.setCenterAndZoom(new mxn.LatLonPoint(45.559242,-122.636467),
15);
marker = new mxn.Marker(new mxn.LatLonPoint(45.559242,
2008 Apr 22
1
Bug in poly() (PR#11243)
Full_Name: Russell Lenth
Version: 2.6.2
OS: Windows XP Pro
Submission from: (NULL) (128.255.132.36)
The poly() function allows a higher-degree polynomial than it should, when
raw=FALSE.
For example, consider 5 distinct 'x' values, each repeated twice. we can fit a
polynomial of degree 8:
=====
R> x = rep(1:5, 2)
R> y = rnorm(10)
R> lm(y ~ poly(x, 8))
Call:
lm(formula = y ~
2012 Dec 10
3
equivalent of group command of the egen function in Stata
Dear R listers,
I am trying to create a new variable that uniquely identifies groups of
observations in a dataset. So far I couldn't figure out how to do this in
R. In Stata I would simply type:
egen newvar = group(dim1, dim2, dim3)
Please, find below a quick example to show what I am dealing with:
I have a dataset with 4 variables:
var <- runif(50) ## a variable that I want to group
2012 Dec 21
2
how to recode an ordered factor
Dear R helpers,
I'm trying to recode an ordered factor to reverse its scale, but I can't
figure out how to make it. I am using the Recode function provided by the
Car package.
I've created an ordered variable:
data$o.var1 <- ordered(data$var1, levels=c(1,2,3,4), labels =c("very
satisfied", "fairly satisfied", "not very satisfied", "not at all
2012 Dec 23
1
Esttab error while exporting regression results
Dear listers,
I am trying to export a regression output to a latex document using the R
package eststo.
I have two variables:
an ordered factor:
group <- gl(3,5,20, labels=c("Ctl","Trt","prp"))
and a continuous variable:
weight <- runif(20)
I want to regress weight over group, therefore I run:
reg1 <- lm(weight ~ group)
I wish to include the output of my
2013 Jan 10
1
help with knit_hooks
Dear R-listers,
does anybody can suggest some manual where I can learn more about how the
hooks in knitr work?
I am trying to enclose the output of an R command in the Latex verbatim
environment.
I defined a hook as follows:
knit_hooks$set(fsverb = function(x, options) {
paste("\\begin(verbatim)\n", x, "\\end(verbatim)\n", sep = "")
}
then I set a chunk as
2013 Jan 08
2
how to label two figures in the same chunk independently with knitr
Dear R helpers,
I am using knitr to run analysis with R and edit my document with Latex. I
am wondering whether there is a way to include 2 or more pictures per chunk
and being able to refer them in the text independently and eventually
whether it is possible to give them different captions. Let me give you an
example.Rnw:
\documentclass{article}
\title{Example}
\author{FS}
\begin{document}
2013 Jan 23
1
problems with coercing a factor to be numeric
Dear R listers,
I am trying to compute the mean of a dummy variable that is encoded as a
factor. However, even though the levels of my factor are 0 - 1, when I
compute the mean (after coercing the factor to be
numeric), R changes 0 into 1 and 1 into yes, thus altering my expected
result.
Please, consider the following working example:
pp <- rep(0:1, 10)
pp <- factor(pp, levels=(0:1),
2009 Mar 12
3
Map using projection
Hi list,
I have a real problem with plotting US state map. When I try to plot the
northern state, there will be some blank space in the top of graph (see case
1 example), and when I plot southern states, there will be a blank space in
the bottom of plot (see case 2). I spent almost 2 days to figure out a
solution, but could not. Would you help me if you know what the problem is?
Regards,
Alireza
2006 Nov 07
3
question on multilevel modeling
Hi,
I am trying to run a multilevel model with time nested in people and
people nested in dyads (3 levels of nesting) by initially running a
series of models to test whether the slope/intercept should be fixed or
random. The problem that I am experiencing appears to arise between the
random intercept, fixed slope equation AND.
(syntax:
rint<-lme(BDIAFTER~BDI+WEEK+CORUMTO,
2007 Nov 28
1
question about warning message in nlme model
I am writing to inquire about a warning message that I receive when
trying to model a random slope and intercept at the second level of a
3-level model. Specifically, I am testing a 3-level model in which
time (WEEK) is nested in participants (PARTICIP) and participants are
nested in dyads (DYADID). The goal is to examine how an interpersonal
style (CORUMTO) one week predicts changes in
2012 Dec 22
0
texreg error while exporting regression table
Dear listers,
I am trying to export my regression table to my latex document.
Let's say I have two variables:
an ordered factor:
group <- gl(3,5,20, labels=c("Ctl","Trt","prp"))
and a continuous variable:
weight <- runif(20)
I want to regress group over weigth, therefore I run:
reg2 <- polr(group ~ weight, Hess = TRUE, method = "logistic",
2011 Oct 12
3
labels in a boxplot
Dear R-listers,
I have a little problem with a boxplot and I hope you can help me figuring
it out.
I'll try to make up some data to illustrate the issue. Sorry, if my
procedures look naive, but these are my first steps in R. Any comments
and/or suggestions are very welcome.
let's create a vector var1:
var1 <- rnorm(100)
and 5 five logical vectors. In this case the vectors don't
2013 Jan 08
1
ggplot not showing all the years on the x-axis
Dear R helpers,
I am currently having hard time fixing the values on the x-axis of a plot
with ggplot: even though I have 12 years, ggplot plots only 3 of them.
Here is my example:
library(ggplot2)
ii <- 2000:2011
ss <- rnorm(12,0,1)
pm <- data.frame(ii,ss)
tmpplot <- ggplot(pm, aes(x = ii, y = ss))
plot <- tmpplot + geom_line()
plot
In my case, ggplot reports on the year 2000,
2011 Sep 18
2
troubles with a for loop
Dear all,
I am a stata user and I am moving my first steps in R.
I am dealing with a silly issue concerning looping over variables. I read
previous posts on similar topics in the R help archive, but I did not find a
solution.
Here is my case:
I run a simple bivariate linear regression saving the output in objects
called: pd.memb.0, pd.memb.1, pd.memb.2, pd.memb.3
pd.memb.0 <- lm(E.fs.memb ~
2012 Feb 19
2
barplot with more than 1 variable
Dear R listers,
I am trying to produce a simple (for a stata user) barplot with 4
countries on the x axis, each country observed in 2 subsequent years
and 3 variables.
Basically, I should have three bars for each year for each country. I
am attaching the chart I made in Stata, but I am not sure you'll
manage to see it!
I did the following:
#here I create the data-set TUSE2. The vectors mw, st
2012 Dec 20
2
how to make a table of summary statistics
Dear R-listers,
I am a newbie with R and I am struggling with something I consider very
basic. I wish to produce a table (to import in a latex file) of summary
statistics, but for as much as I've been looking around and trying various
alternatives (plyr, reporttools, pastecs and Hmisc) I haven't found what I
am looking for. Probably I am doing something wrong, but I can't figure out
2012 Mar 05
1
problems reading a large dta dataset in R
Dear R listers,
I have a silly problem. I am trying to load a dta (Stata) file in R.
The dta is about 650 MB and contains the integrated World Values
Survey/ European Value Study data-set.
My problem is that I don't manage to load the file. After almost 3
hours after I issued the following command:
data <-
2012 Mar 01
1
R can't load a large dataset
Dear R listers,
I have a silly problem. I am trying to load a dta (Stata) file in R.
The dta is about 650 MB and contains the integrated World Values
Survey/ European Value Study data-set.
My problem is that I don't manage to load the file. After almost 1
hour I issued the following command:
data <- read.dta("http://www.stata-press.com/data/kkd/data1.dta",
convert.dates = TRUE,
2013 Jan 08
0
Oaxaca-Blinder decomposition in R
Dear R-listers,
does anybody know of any package developed to implement the Oaxaca-Blinder
decomposition in R?
I've been googling around and my reserch has been unfruitful. The latest
news I've found were 1 year old. Does anybody know of any recent
development?
Has R ever been employed to run a Oaxaca-Blinder decomposition?
Thanks for your kind support,
f.
[[alternative HTML version