Displaying 20 results from an estimated 7000 matches similar to: "Robust regression for ordered data"
2012 Jul 05
4
Exclude missing values on only 1 variable
Hello,
I have many hundred variables in my longitudinal dataset and lots of
missings. In order to plot data I need to remove missings.
If I do
> data <- na.omit(data)
that will reduce my dataset to 2% of its original size ;)
So I only need to listwise delete missings on 3 variables (the ones I am
plotting).
data$variable1 <-na.omit(data$variable1)
does not work.
Thank you
2010 Jul 21
1
The opposite of "lag"
Hello!
I have a data frame A (below) with a grouping factor (group). I take
my DV and create the new, lagged DV by applying the function lag.it
(below). It works fine.
A <- data.frame(year=rep(c(1980:1984),3), group=
factor(sort(rep(1:3,5))), DV=c(rnorm(15)))
lag.it <- function(x) {
DV <- ts(x$DV, start = x$year[1])
idx <- seq(length = length(DV))
DVs <- cbind(DV, lag(DV,
2009 Aug 26
2
simple graph question: manipulating variable names
This is a simple problem that has stumped me: I'm trying to loop through a
few dozen variable names in graphs. I've tried various approaches like
this:
attach(mydata)
ivs <- c("oneiv", "anotheriv", "yetanotheriv")
dvs <- c("onedv", "anotherdv", "yetanotherdv")
for (iv in ivs) {
for (dv in dvs) {
graphname <- paste(iv,
2008 Jun 22
1
two newbie questions
# I've tried to make this easy to paste into R, though it's probably
so simple you won't need to.
# I have some data (there are many more variables, but this is a
reasonable approximation of it)
# here's a fabricated data frame that is similar in form to mine:
my.df <- data.frame(replicate(10, round(rnorm(100, mean=3.5, sd=1))))
var.list <- c("dv1",
2012 Nov 29
2
Confidence intervals for estimates of all independent variables in WLS regression
I would like to obtain Confidence Intervals for the estimates
(unstandardized beta weights) of each predictor in a WLS regression:
m1 = lm(x~ x1+x2+x3, weights=W, data=D)
SPSS offers that output by default, and I am not able to find a way to do
this in R. I read through predict.lm, but I do not find a way to get the
CIs for multiple independent variables.
Thank you
Torvon
[[alternative HTML
2012 Apr 24
1
Number of lines in analysis after removed missings
I have a dataset with plenty of variables and lots of missing data. As far
as I understand, R automatically removes subjects with missing values.
I'm trying to fit a mixed effects model, adding covariate by covariate. I
suspect that my sample gets smaller and smaller each time I add a
covariate, because more and more lines get deleted.
Is there a way of displaying how many subjects are
2012 Nov 09
1
Remove missings (quick question)
A colleague wrote the following syntax for me:
D = read.csv("x.csv")
## Convert -999 to NA
for (k in 1:dim(D)[2]) {
I = which(D[,k]==-999)
if (length(I) > 0) {
D[I,k] = NA
}
}
The dataset has many missing values. I am running several regressions on
this dataset, and want to ensure every regression has the same subjects.
Thus I want to drop subjects listwise for
2012 May 06
2
Interaction plot between 2 continuous variables
I have two very strong fixed effects in a LMM (both continuous variables).
model <- lmer( y ~ time + x1+x2 + (time|subject))
Once I fit an interaction of these variables, both main effects
disappear and I get a strong interaction effect.
model <- lmer( y ~ time + x1*x2 + (time|subject))
I would like to plot this effect now, but have not been able to do so,
reading through ggplot2 and
2012 Oct 14
2
Poisson Regression: questions about tests of assumptions
I would like to test in R what regression fits my data best. My dependent
variable is a count, and has a lot of zeros.
And I would need some help to determine what model and family to use
(poisson or quasipoisson, or zero-inflated poisson regression), and how to
test the assumptions.
1) Poisson Regression: as far as I understand, the strong assumption is
that dependent variable mean = variance.
2012 Oct 22
1
glm.nb - theta, dispersion, and errors
I am running 9 negative binomial regressions with count data.
The nine models use 9 different dependent variables - items of a clinical
screening instrument - and use the same set of 5 predictors. Goal is to
find out whether these predictors have differential effects on the items.
Due to various reasons, one being that I want to avoid overfitting models,
I need to employ identical types of
2012 Feb 29
1
Coding help
Dear Group,
I have the following dataset:
ID REPI DV CONC SS
1 1 156.84 116 0
1 2 146.56 116 0
1 3 115.13 116 0
1 4 207.81 116 0
1 5 129.53 116 0
1 6 151.48 116 0
1 7 158.95 116 0
1 8 192.37 116 0
1 9 32.97 116 0
1 10 151.66 116 0
I want to calculate the percentile of each CONC within ID=i and add as a
column
2002 Apr 24
3
nonlinear least squares, multiresponse
I'm trying to fit a model to solve a biological problem.
There are multiple independent variables, and also there are multiple
responses.
Each response is a function of all the independent variables, plus a set of
parameters. All the responses depend on the same variables and parameters -
just the form of the function changes to define each seperate response.
Any ideas how I can fit
2011 Jul 01
1
Poisson GLM with a logged dependent variable...just asking for trouble?
Dear R-helpers,
I'm using a GLM with poisson errors to model integer count data as a
function of one non-integer covariate.
The model formula is: log(DV) ~ glm(log(IV,10),family=poisson).
I'm getting a warning because the logged DV is no longer an integer.
I have three questions:
1) Can I ignore the warning, or is logging the DV (resulting in
non-integers) a serious violation of the
2009 Oct 16
1
Breusch-pagan and white test - check homoscedasticity
Hi r-programmers,
I performe Breusch-Pagan tests (bptest in package lmtest) to check the
homoscedasticity of the residuals from a linear model and I carry out carry
out White's test via
bptest (formula, ~ x * z + I(x^2) + I(z^2)) include all regressors and the
squares/cross-products in the auxiliary regression.
But what can I do if I want find coefficient and p-values of variables x, z,
x*z,
2012 Apr 15
2
xyplot type="l"
Probably a stupidly simple question, but I wouldn't know how to google it:
xyplot(neuro ~ time | UserID, data=data_sub)
creates a proper plot.
However, if I add
type = "l"
the lines do not go first through time1, then time2, then time3 etc but in
about 50% of all subjects the lines go through points seemingly random
(e.g. from 1 to 4 to 2 to 5 to 3).
The lines always start at time
2009 Oct 09
1
variance ratio tests
Hello
I am a new user of R software. I benefit from using vrtest-package. However, the codes provided by the aforementioned package, for example, calculate the test statistics for Lo and Mackinlay (1988) under the assumptions of homoscedasticity and heteroscedasticity without computing the value of the variance ratio itself.
I would be grateful if you could instruct me how to calculate the
2013 Oct 27
2
Heteroscedasticity and mgcv.
I have a two part question one about statistical theory and the other
about implementations in R. Thank you for all help in advance.
(1) Am I correct in understanding that Heteroscedasticity is a problem for
Generalized Additive Models as it is for standard linear models? I am
asking particularly about the GAMs as implemented in the mgcv package.
Based upon my online search it seems that some
2018 Apr 06
1
Fast tau-estimator line does not appear on the plot
R-experts,
I have fitted many different lines. The fast-tau estimator (yellow line) seems strange to me?because this yellow line is not at all in agreement with the other lines (reverse slope, I mean the yellow line has a positive slope and the other ones have negative slope).
Is there something wrong in my R code ? Is it because the Y variable is 1 vector and should be a matrix ?
Here is the
2005 Oct 12
2
linear mixed effect model with ordered logit/probit link?
Hello,
I'm working on the multiple categorical data (5-points scale) using linear
mixed effect model and wondering if anyone knows about or works on the
linear mixed effect model with ordered logit or probit link.
I found that the "lmer" function in R is very flexible and supports
various models, but not ordered logit/probit models. I may conduct my
analysis by turning my DVs
2013 Oct 09
1
mixed model MANOVA? does it even exist?
Hi,
Sorry to bother you again.
I would like to estimate the effect of several categorical factors (two
between subjects and one within subjects) on two continuous dependent
variables that probably covary, with subjects as a random effect. *I want
to control for the covariance between those two DVs when estimating the
effects of the categorical predictors** on those two DVs*. The thing is, i