Displaying 20 results from an estimated 1000 matches similar to: "Questions on factors in regression analysis"
2011 Oct 27
2
Syntax Check: rshape2 melt()
This is my first excursion into using reshape2 and I want to ensure that
the melt() function call is syntactically correct.
The unmodifed data frame is organized this way:
head(tds.anal)
site sampdate param quant
1 UDS-O 2006-12-06 TDS 10800
4 STC-FS 1996-06-14 Cond 280
7 UDS-O 2007-10-04 Mg 1620
9 UDS-O 2007-10-04 SO4 7580
19 JCM-10B 2007-06-21 Ca 79
20
2011 Aug 30
3
Descriptive Stats from Data Frame
I don't find how to do what I need to do in Dalgaard or 'R Cookbook', so
I'm asking here.
I have a data frame with water chemistry data and I want to start
exploring these data. There are three factors (site, date, chemical)
associated with each measurement. The data frame looks like this:
> summary(chemdata)
site_id.sample_date.param.quant
2011 Oct 24
2
Syntax Help for xyplot()
Thanks to David's help I subset my large data set and produced a smaller
one for a single stream and 7 factors of interest. The structure of this
data frame is:
str(burns.tds.anal)
'data.frame': 718 obs. of 4 variables:
$ site : Factor w/ 143 levels "BC-0.5","BC-1",..: 1 1 4 6 4 4 4 5 5 5
$ sampdate: Date, format: "1996-06-02"
2013 Feb 02
1
Mixed Models: Contribution of random variable to final estimate
Dear all,
We want to test if the invasiveStatus is predicted by the amount (quant) of animals arriving to a country of a certain species (taxonid). We are using lmer to perform the model.
The model is:
lmer(invasiveStatus~I(log(quant+1))+I(log(inDegree+1))+(1|taxonid)+(1|country), family=binomial,data=td),
where invasiveStatus is a binary variable, quant and inDegree are integer variables, and
2012 Jun 07
1
Quantile regression: Discrepencies Between optimizer and rq()
Hello Everyone,
I'm currently learning about quantile regressions. I've been using an
optimizer to compare with the rq() command for quantile regression.
When I run the code, the results show that my coefficients are consistent
with rq(), but the intercept term can vary by a lot.
I don't think my optimizer code is wrong and suspects it has something to do
with the starting
2010 May 16
1
problems with generation of quantiles under For ()
Dear, I want to make an application to calculate quantile within a For()
I tried the following without success:
ej.
date
p_val <- matrix(sample(10, 1000, replace=TRUE), 200,5)
test 1
rr <- paste("p_val$",names(p_val[1]), sep="")
quant <- quantile(rr, probs = c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90,
100)/100, na.rm=FALSE, type=1)
test 2
rr <-
2012 May 08
1
what folder to run write_PACKAGES in?
I set up a local repo for testing packages. My packages are not
showing up from the repository when viewed by Linux clients. I suspect
this is a web administrator/firewall issue, but it could be I created
the repo wrongly. I am supposed to run write_PACKAGES separately in
each R-version folder. Right?
Maybe other novices can use these scripts, if they are not wrong :)
Here's the file
2009 Apr 25
3
Nomogram with stratified cph in Design package
Hello,
I am using Dr. Harrell's design package to make a nomogram. I was able to
make a beautiful one without stratifying, however, I will need to stratify
to meet PH assumptions. This is where I go wrong, but I'm not sure where.
Non-Stratified Nomogram:
2005 Dec 20
3
Overlaying lattice plots
Hillary, Richard M wrote:
> Morning chaps, I have a little question for your capable minds... Say
> I have an observed and predicted set of quants (in my case, length
> frequencies by year and age/length), is there a way to use lattice
> plots to plot the observed and predicted data together, panel by panel?
> Obrigado/gracias (thankyou in Galego is?...)
> Rich
Hi Richard,
If
2005 Dec 20
3
Overlaying lattice plots
Hillary, Richard M wrote:
> Morning chaps, I have a little question for your capable minds... Say
> I have an observed and predicted set of quants (in my case, length
> frequencies by year and age/length), is there a way to use lattice
> plots to plot the observed and predicted data together, panel by panel?
> Obrigado/gracias (thankyou in Galego is?...)
> Rich
Hi Richard,
If
2011 Dec 28
1
subset() missing one factor
The data set (called 'chemdata') has 6 columns (4 factors, 1 date, 1
numeric) and I need to create subsets for each of one of the factors
('stream'). This has worked flawlessly for all but two streams which were
created yesterday.
The command I use to create the subsets is like this:
> rnchH <- subset(chemdata, stream == 'RanchSpgsH', select = c(site, sampdate,
2012 Oct 23
1
Understanding lattice barchart() display
I've a data frame with this structure:
'data.frame': 1987 obs. of 11 variables:
$ site : Factor w/ 24 levels "B(W)","BC-1",..: 1 1 2 2 2 1 1 1 ...
$ sampdate : Date, format: "2000-07-18" "2000-07-18" ...
$ tclass : Factor w/ 8 levels "Annelida","Arachnida",..: 1 5 5 5 5 ...
$ torder : Factor
2012 Sep 28
1
Lattice bwplot(): Conditioning on one factor
I'm not able to create the proper syntax to specify a lattice bwplot() for
only one of two conditioning factors.
The syntax that produces a box plot of each of the two conditioning
factors is:
bwplot(quant ~ param | era, data=mg.d, main='Dissolved Magnesium', ylab='Concentration (mg/L)')
What I've tried unsuccessfully are:
bwplot(quant ~ param |
2007 Oct 03
2
Shading area under density curves
Hello,
I have a question regarding shading regions under curves to display
95% confidence intervals. I generated bootstrap results for the slope
and intercept of a simple linear regression model using the following
code (borrowed from JJ Faraway 2005):
> attach(allposs.nine.d)
> x<-model.matrix(~log(d.dist,10))[,-1]
> bcoef<-matrix(0,1000,2)
> for(i in 1:1000){
+
2012 Jul 10
2
Understanding cenros Error
Before reading water chemistry into a data frame I removed all missing
data. Yet when I try to run cenros() to summarize a specific chemical I get
an error that I do not understand:
with( subset(chem, param=='Ag'), cenros(quant,ceneq1) )
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in 'y'
I would like to learn what I did incorrectly
2011 Aug 31
2
Entering Multiline Commands With ESS
If there's a separate ESS user mail list, please point me to it.
I'm using emacs with ESS and want to enter multiline commands for plots.
Examples in my reference books show each line terminating with a comma so
labels and other attributes can be specified for the plot before it is
submitted for rendering. When I try to do this, however, I get an error:
> boxplot(chemdata$quant ~
2016 Feb 12
1
Change Rscript and `/usr/lib/R/bin/R` relation
On Wed, 10 Feb 2016 10:18:51 -0600, Dirk Eddelbuettel wrote:
> Thanks for bringing the question over from StackOverflow [1]. I am not
> very impressed that you STILL hide behind a pseudonym and I am starting
> to question my sanity as to why I take time out to help someone like
> that. Anyway, read on ...
>
> [1]
2011 Sep 22
3
Bivariate Scatter Plots with Lattice
Data frame has this structure:
'data.frame': 11169 obs. of 4 variables:
$ stream : Factor w/ 37 levels "Burns","CIL",..: 1 1 1 1 1 1 1 1 1 1 ...
$ sampdate: Date, format: "1987-07-23" "1987-09-17" ...
$ param : Factor w/ 8 levels "As","Ca","Cl",..: 1 1 1 1 1 1 1 1 1 1 ...
$ quant : num 0.01 0.01 0.01 0.01
1999 Nov 19
2
Impulses
After playing with the vorbis code for a while and doing tons of hacks and
analysis on it, I've found it to perform very poorly with impulse signals.
The MDCT seems to cause lots of spreading, and it seems to result in much
worse impulse performance then mp3.
What is the current plan on handling this? Will a smart quantizer be able
to avoid it?
I've been looking at various ways of
2010 May 17
3
applying quantile to a list using values of another object as probs
Hi r-users,
I have a matrix B and a list of 3x3 matrices (mylist). I want to
calculate the quantiles in the list using each of the value of B as
probabilities.
The codes I wrote are:
B <- matrix (runif(12, 0, 1), 3, 4)
mylist <- lapply(mylist, function(x) {matrix (rnorm(9), 3, 3)})
for (i in 1:length(B))
{
quant <- lapply (mylist, quantile, probs=B[i])
}
But quant