similar to: Number of lines in analysis after removed missings

Displaying 20 results from an estimated 10000 matches similar to: "Number of lines in analysis after removed missings"

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 Oct 07
3
Robust regression for ordered data
I have two regressions to perform - one with a metric DV (-3 to 3), the other with an ordered DV (0,1,2,3). Neither normal distribution not homoscedasticity is given. I have a two questions: (1) Some sources say robust regression take care of both lack of normal distribution and heteroscedasticity, while others say only of normal distribution. What is true? (2) Are there ways of using robust
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
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 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
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 Jun 16
2
How to specify "newdata" in a Cox-Modell with a time dependent interaction term?
Dear Mr. Therneau, Mr. Fox, or to whoever, who has some time... I don't find a solution to use the "survfit" function (package: survival) for a defined pattern of covariates with a Cox-Model including a time dependent interaction term. Somehow the definition of my "newdata" argument seems to be erroneous. I already googled the problem, found many persons having the
2012 Jan 26
2
R extracting regression coefficients from multiple regressions using lapply command
Hi, I have a question about running multiple in regressions in R and then storing the coefficients. I have a large dataset with several variables, one of which is a state variable, coded 1-50 for each state. I'd like to run a regression of 28 select variables on the remaining 27 variables of the dataset (there are 55 variables total), and specific for each state, ie run a regression of
2011 Apr 22
1
Survival analysis: same subject with multiple treatments and experience multiple events
Hi there, I need some help to figure out what is the proper model in survival analysis for my data. Subjects were randomized to 3 treatments in trial 1, some of them experience the event during the trial; After period of time those subjects were randomized to 3 treatments again in trial 2, but different from what they got in 1st trial, some of them experience the event during the 2nd trial (I
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
2013 Apr 08
1
qgraph: correlation matrix variable names
We aim to visualize a 17*17 correlation matrix with the package *qgraph*, consisting of 16 variables. Without variable names in the input file, that works perfectly R> qgraph(data) but we'd like variable names instead of numbers for variables. In a correlation matrix, the first row and the first column usually have variable names. We've been unsuccessful so far to read such a file
2002 Jun 19
1
best selection of covariates (for each individual)
Dear All, This is not strictly R related (though I would implement the solution in R; besides, being this list so helpful for these kinds of stats questions...). I got a "strange" request from a colleage. He has a bunch (approx. 25000) subjects that belong to one of 12 possible classes. In addition, there are 8 covariates (factors) that can take as values either "absence"
2011 Nov 30
1
SAS to R: I would like to replicate a statistical analysis performed in SAS in R.
Hello everybody, A statistician performed an analysis in SAS for me which I would like to replicate in R. I have however problems in figuring out the R code to do that. As I understood it was a "covariance regression model". In the analysis, baseline was used as covariate and autoregressive (1) as covariance structure. The model included baseline, session, group and interaction
2012 Apr 23
1
save model summary
Hello, I'm working with RStudio, which does not display enough lines in the console that I can read the summary of my (due to the covariance-matrix rather long) model. There are no ways around this, so I guess I need to export the summary into a file in order to see it ... I'm new to R, and "R save model summary" in google doesn't help, neither does "help(save)"
2012 Oct 13
1
WLS regression weights
Hello. I'm am trying to follow a recommendation to deal with a dependent variable in a linear regression. I read that, due to the positive trend in my dependent variable residual vs mean function, I should 1) run a linear regression to estimate the standard deviations from this trend, and 2) run a second linear regression and use 1 / variance as weight. These might be terribly stupid
2012 Nov 19
1
Error in `[.data.frame`... undefined columns selected
When I run this script on 9 variables, it works without problems. Z <- data[,c("s1_1234_m","s2_1234_m","s3_1234_m","s4_1234_m","s5_1234_m","s6_1234_m","s7_1234_m","s8_1234_m","s9_1234_m" )] However, when I run the script on 9 different variables, it does not work: Z <-
2012 Jun 28
1
Simple mean trajectory (ordinal variable)
Hello. I have 5 measurement points, my dependent variable is ordinal (0 - 3), and I want to visualize my data. I'm pretty new to R. What I want is to find out whether people with different baseline covariates have different trajectories, so I want a plot with the means trajectory of my dependent variable (the individual points do not make a lot of sense in ordinal data) on each measurement
2012 Jul 13
2
Power analysis for Cox regression with a time-varying covariate
Hello All, Does anyone know where I can find information about how to do a power analysis for Cox regression with a time-varying covariate using R or some other readily available software? I've done some searching online but haven't found anything. Thanks, Paul
2010 Jul 23
1
Survival analysis MLE gives NA or enormous standard errors
Hi, I am trying to fit the following model: sr.reg.s4.nore <- survreg(Surv(age_sym4,sym4), as.factor(lifedxm), data=bip.surv) Where age_sym4 is the age that a subject develops clinical thought problems; sym4 is whether they develop clinical thoughts problems (0 or 1); and lifedxm is mother's diagnosis: BIPOLAR, MAJOR DEPRESSION, or CONTROL. I am interested in whether or not