Displaying 20 results from an estimated 2000 matches similar to: "Problem with by(... , median)"
2008 Jul 21
5
Coefficients of Logistic Regression from bootstrap - how to get them?
Hello all,
I am trying to optimize my logistic regression model by using bootstrap.
I was previously using SAS for this kind of tasks, but I am now
switching to R.
My data frame consists of 5 columns and has 109 rows. Each row is a
single record composed of the following values: Subject_name, numeric1,
numeric2, numeric3 and outcome (yes or no). All three numerics are used
to predict
2011 Mar 23
2
Estimating correlation in multiple measures data
Dear R-helpers,
This may sound simple to you, but I'm a beginner in this, so please be
forgiving.
I have a following problem: two analytes were measured in patient's
blood on 4 occasions: ProteinA and ProteinB. How to correctly evaluate
correlation between ProteinA and ProteinB?
I tried:
x <- data.frame(Patient.ID=rep(1:10, each=4), Visit=rep(c(1:4),10),
ProteinA=rnorm(m=10,
2010 May 26
3
Problem with plotting survival predictions from cph model
Dear R-helpers,
I am working with 'cph' models from 'rms' library. When I build simple
survival models, based on 'Surv(time, event)', everything is fine and I
can make nice plots using plot(Predict(f, time=3)).
However, recently I tried to be more specific and used 'Surv(start,
stop, event)' type model. Using this model 'plot(Predict(f))' works OK,
but
2009 Aug 05
1
Starting NONMEM (nmfe6) from R
Hello,
I have made an R script that prepares a NONMEM dataset and I would like
to start the NONMEM run right after the dataset is ready.
I am using windows XP, R 2.9.1 and NONMEM 6.
I have prepared a run.bat file that looks like this:
----------------------------------------
call K:\nmvi\NMdirectories.bat
call K:\nmvi\nmfe6 "path\control.txt" "path\output.txt"
2010 Mar 30
5
Problem comparing hazard ratios
Dear R-Helpers,
I am a novice in survival analysis. I have the following code:
for (i in 3:12) print(coxph(Surv(time, status)~a[,i], data=a))
I used it to fit the Cox Proportional Hazard models separately for every
available parameter (columns 3:12) in my data set - with intention to
compare the Hazard Ratios.
However, some of my variables are in range 0.1 to 1.6, others in range
5000 to
2012 May 02
2
Problem with 'nls' fitting logistic model (5PL)
Dear R-Helpers,
I'm working with immunoassay data and 5PL logistic model. I wanted to
experiment with different forms of weighting and parameter selection,
which is not possible in instrument software, so I turned to R.
I am using R 2.14.2 under Win7 64bit, and the 'nls' library to fit the
model - I started with the same model and weighting type (1/y) as in the
instrument to see
2009 Dec 08
1
{Lattice} help.
Hi All,
I have a 4-dimensional data. I'm using barchart() function from lattice
package. The R code and data are below - code includes one for stack=TRUE
and other for stack=FALSE.
I would like to present the data in another form which would be plotting
Factor3 levels (P, Q, R, S) as two stacked bars (side by side). Like, for
each level of Factor1 there should be two bars: first bar showing
2009 Dec 03
2
(Grouped + Stacked) Barplot
Hi All,
I have googled and tried finding if someone has ever tried producing
(Grouped + Stacked) Barplot. I couldn't find one.
My data needs to be reshaped, but once it is done it would be something like
this:
Factor1 Factor2 Factor3 Value
A X P 10
A X Q 20
A Y P 20
A Y Q 5
A Z P 20
A Z Q 10
B X P 20
B X Q 10
B
2009 Mar 31
3
Factor Analysis Output from R and SAS
Dear Users,
I ran factor analysis using R and SAS. However, I had different outputs from
R and SAS.
Why they provide different outputs? Especially, the factor loadings are
different.
I did real dataset(n=264), however, I had an extremely different from R and
SAS.
Why this things happened? Which software is correct on?
Thanks in advance,
- TY
#R code with example data
# A little
2010 Oct 21
1
Big data (over 2GB) and lmer
Dear R-helpers
I have a data set of roughly 10 million records, 7 columns. It has only
about 500MB as a csv, so it fits in the memory. It's painfully slow to
do anything with it, but it's possible. I also have another dataset of
covariates that I would like to explore - with about 4GB of data...
I would like to merge the two datasets and use lmer to build a mixed
effects model. Is
2010 Jan 12
3
How to get minimum value by group
I'd like to get a long data set of minimum values from groups in another data
set.
The following almost does what I want. (Note, I'm using the word factor
differently from it's meaning in R; bad choice of words)
myframe = data.frame(factor1 = rep(1:2,each=8), factor2 =
rep(c("a","b"),each=4, times=2), factor3 = rep(c("x","y"),each=2, times=4),
2010 Aug 10
3
Plotting confidence bands around regression line
Dear R-helpers and graphics gurus,
I have two problems with plotting confidence bands:
1. First is relatively simple. I am using the Passing-Bablok procedure
to obtain "unbiased" regression coefficients. This procedure yields the
"a" & "b" coefficient values along with their confidence intervals. I
then plot the raw data with the regression line, but I would
2003 Jan 20
1
make check for R-1.6.2 on IBM AIX
Dear all,
The 'make check' step fails for the pacakge mva on IBM AIX.
The tail of the Rout log file looks like:
> for(factors in 2:4) print(update(Harman23.FA, factors = factors))
Call:
factanal(factors = factors, covmat = Harman23.cor)
Uniquenesses:
height arm.span forearm lower.leg weight
0.170 0.107 0.166
2013 Mar 07
3
ggpliot2: reordering of factors in facets facet.grid(). Reordering of factor on x-axis no problem.
Hi everyone (again),
before you all start screaming that the reordering of factors has been
discusse on several threads and is not particular to ggplot2, hear me out.
I can easily reorder my x-axis factor in facet.grid() in ggplot2. What I
cannot reorder are the factors represented on the strips. I can see that the
graphs are changing, so I am afraid of what it is I am doing. Why is ggplot2
2005 Apr 05
1
extracting Proportion Var and Cumulative Var values from factanal
Hi R users,
I need some help in the followings:
I'm doing factor analysis and I need to extract the loading values and
the Proportion Var and Cumulative Var values one by one.
Here is what I am doing:
> fact <- factanal(na.omit(gnome_freq_r2),factors=5);
> fact$loadings
Loadings:
Factor1 Factor2 Factor3 Factor4 Factor5
b1freqr2 0.246 0.486 0.145
2006 Aug 11
1
- factanal scores correlated?
Hi,
I wonder why factor scores produced by factanal are correlated, and I'd
appreciate any hints from people that may help me to get a deeper
understanding why that's the case. By the way: I'm a psychologist used
to SPSS, so that question my sound a little silly to your ears.
Here's my minimal example:
***********************************************
v1 <-
2013 Mar 06
6
Ggplot2: Moving legend, change fill and removal of space between plots when using grid.arrange() possible use of facet_grid?
Hi,
# For publications, I am not allowed to repeat the axes. I have tried to
remove the axes using:
# yaxt="n", but it did not work. I have not understood how to do this in
ggplot2. Can you help me?
# I also do not want loads of space between the graphs (see below script
with Dummy Data).
# If I could make it look like the examples on the (nice) examples page:
#
2010 Apr 29
1
How to estimate the residual SD for each sample separately in mixed-effects model?
Dear R-helpers,
I am developing a Mixed-Effects model for a study of immunoassays using
'lme4' library. The study design is as follows: 10 samples were run
using 7 different immunoassays, 3 times each, in duplicates. Data
attached. I have developed the following model:
c.lme <- lmer(Result~SPL + (SPL|Assay/Run) -1, data=data)
This model has excellent predictions - the Rsquared of
2011 Apr 27
2
multiple comparisons on a between factor
Dear list,
im facing an issue of statistical data analysis that I consider myself
unable to resolve in R so i hope to get some valuable insights from you. i
run an ANOVA with four factors; factor4 is an between factor (two different
groups measured), the others are withins (tested across /all/ subjects).
accordingly, my model looks as follows:
fm1
2010 Jan 15
1
'nlme' library - lme function results
Dear R-helpers
I am running a simple mixed effects model using lme(). The call looks
like this:
fit <- lme(Analyte~Sample, data=Data, random=~1 | Run)
I am particularly interested in the estimated random effects. When I
print the 'fit' object, it looks something like example below:
(...)
Random effects:
Formula: ~1 | Run
(Intercept) Residual
StdDev: 3.483794 3.637523