Displaying 20 results from an estimated 8000 matches similar to: "R Style Guide -- Was Post-hoc tests in MASS using glm.nb"
2011 May 16
2
Post-hoc tests in MASS using glm.nb
I am struggling to generate p values for comparisons of levels (post-hoc
tests) in a glm with a negative binomial distribution
I am trying to compare cell counts on different days as grown on different
media (e.g. types of cryogel) so I have 2 explanatory variables (Day and
Cryogel), which are both factors, and an over-dispersed count variable
(number of cells) as the response. I know that both
2011 May 12
3
assigning creating missing rows and values
I have a dataset where I have missing times (11:00 and 16:00). I would like
the outputs to include the missing time so that the final time vector looks
like "realt" and has the previous time's value. Ex. If meas at time 15:30 is
0.45, then the meas for time 16:00 will also be 0.45.
meas are the measurements and times are the times at which they were taken.
meas<-runif(18)
2011 May 26
4
Applying "toupper" to only portions of text strings
Colleagues
Assume that I have a vector containing some text strings, some of which contain a particular character. I could like to apply "toupper" to the text before the character. For example (in this case, "|" is the particular character):
ORIGINAL:
TEXT <- c("aaaa", "bbb|cc", "|ddd")
AFTER APPLICATION OF toupper:
TEXT <-
2011 May 15
2
Unexpected behaviour as.data.frame
I use the following code to create two data.frames d1 and d2 from a list:
types <- c("integer", "character", "double")
nlines <- 10
d1 <- as.data.frame(lapply(types, do.call, list(nlines)),
stringsAsFactor=FALSE)
l2 <- lapply(types, do.call, list(nlines))
d2 <- as.data.frame(l2, stringsAsFactors=FALSE)
I would expect d1 and d2 to be the
2011 Oct 11
2
replicate data.frame n times
Hi,
is there a way to replicate a data.frame like you can replicate the entries of a vector (with the repeat-function)?
I want to do this:
x <- data.frame(x, x)
(where x is a data.frame).
but n times.
And it should be as cpu / memory efficient as possible, since n is pretty big in my case.
thanks for any suggestions!
2011 Jul 14
5
Adding rows based on column value
Dear all,
I have one problem and did not find any solution.(I have also attached the problem in text file because sometimes column spacing is not good in mail)
I have a file(file.txt) attached with this mail.I am reading it using this code to make a data frame (file)-
file=read.table("file.txt",fill=T,colClasses = "character",header=T)
file looks like this-
Chr Pos
2011 Jun 28
4
how to print "<=" in plot title
Hi, how can I print "<=" (I mean the symbol of just one character) in the main
title of a plot?
for example:
plot(1:10, main=paste("x <=", x))
where variable x is some number generated on the fly.
Thanks
John
2011 Aug 15
2
Regression - how to deal with past values?
Dear R-users
I need to fit a nonlinear model to a piece of data. The model to be fitted
uses past values of the input and the ouput - something like
y(k) ~ f(y(k-1),y(k-2),u(k),u(k-1) ....) (k is time index). As far as I
know I could use earth(MARS), nnet and etc but I am not sure how to deal
with the past values since most, if not all, examples I saw formula does not
take in account past
2011 Jul 26
5
Help with boxplot
Hi guys,
I need your help with the boxplot.
I've to create a boxplot starting from a table (.csv) in which there are the
result of a test.
Each column is a question and the rows are the answer of the respondents
(from 0 to 5).
Some answer is missing and has been filled with NA.
the table has been loaded in R with the function read.csv
I created the boxplot with the function boxplot and all
2011 May 27
1
FW: FW: Unable to Plot using headers (converting to Numeric)
I tried command
as.numeric(Qty) #converting column"Qty" in object "demand" to
numeric. However it remains a non-numeric value.
What is the best way to convert a column of data to a numeric value in
R?
What is the best way to convert dates into a numeric format (or some
format able to be used in an x,y scatter) while still maintaining its
inherent "date" property?
2011 May 21
4
Looping through values in a data frame that are >zero
Hello!
I've tried for a while - but can't figure it out. I have data frame x:
y=c("a","b","c","d","e")
z=c("m","n","o","p","r")
a=c(0,0,1,0,0)
b=c(2,0,0,0,0)
c=c(0,0,0,4,0)
x<-data.frame(y,z,a,b,c,stringsAsFactors=F)
str(x)
Some of the values in columns a,b, and c are >0:
I need to
2011 Jun 24
4
What does class "call" mean? How do I make class "formula" into a "call"?
I have a list called "tabs" that I would like to have the same structure as my list "eqSystem." The two look like they have the same format but they are different because when I look at their attributes, class(eqSystem[[1]]) is "call" but class(tabs[[1]]) is "formula". I want to have class(tabs[[1]]) as a call too. So what does "call" mean? And how
2011 Jul 06
1
elegant way of removing NA's and selecting specific values from a data.frame
I have a data.frame "e" and would like to extract the 23rd column,
remove any NA's and then remove any values >= 30. I can do it in steps
such as this but have failed to figure out how to do it in a single line
.... any suggestions?
first <- e[,23]
second <- first[!is.na(first)]
third <- second[second<=30]
thanks a bunch
J
--
Dr. Jim Maas
University of East
2011 Aug 20
1
How to abort function execution after x-seconds
Hello all,
I'm running a parameter grid optimization ( ksvm, kernlab package) and
the optimizer
seems not to converge for certain parameters and stays in a infinity loop.
Would it be possible to abort the execution after x-seconds and continue
with the next parameter set? Which R function do need to use to
accomplish this?
I had a look at, try() etc. but they didn't seem so fit my
2011 May 24
1
ANOVA Residual SS and MS of 0
I am trying to run an ANOVA on my soil respiration data, but I keep getting
residual sum of squares and mean square of zero.
As I understand it that would mean that the model terms explain all of the
variation in the response variable. That should be virtually impossible,
should it not?
Where do I begin troubleshooting such a problem?
--
View this message in context:
2011 Apr 09
1
Robust Statistics for Outlier Detection
Hi Dear All,
Can someone give me a suggestion about which robust statistics are most
appropriate for outlier detection in linear models, and is available with R
?
Thanks for any idea.
--
View this message in context: http://r.789695.n4.nabble.com/Robust-Statistics-for-Outlier-Detection-tp3438493p3438493.html
Sent from the R help mailing list archive at Nabble.com.
2011 May 19
1
Converting Variable Name into String
Hello,
I would like to create lagged and delta variables from a set of variables
and then add them to a dataframe
Suppose that GDPPcSa is a variable. I would like to be able to do this
QuarterlyData$D1GdpPcSa = diff(GDPPcSa , 1)
in an automated fashion so that I loop over Quartely data to compute the
first difference of its variables and add them to the dataframe.
.It would be great to get a
2011 May 24
1
anyone using LARS package in R
Hi useR's,
Has anyone used the "Lars" package in R before? If so, is there any tutorial
(not manual) or worked out example online for this R package that one can go
through to figure out how one can use this package with lasso regression?
I appreciate any help I can get in this direction.
Sincerely,
Vishal
--
*Vishal Thapar, Ph.D.*
*Scientific informatics Analyst
Cold Spring
2011 Jun 13
1
Composing two n-dimensional arrays into one n+1-dimensional array
If I have 2 n-dimensional arrays, how do I compose them into a n+1-dimension
array?
Is there a standard R function that's something like the following, but that
gives clean errors, handles all the edge cases, etc.
abind <- function(a,b) structure( c(a,b), dim = c(dim(a), 2) )
m1 <- array(1:6,c(2,3))
m2 <- m1 + 10
abind(m1,m2)
==>
, , 1
[,1] [,2] [,3]
[1,] 1 3 5
2011 Jun 17
1
Factor labels
Please, can you help me with the following? I want to include a Greek letter
as part of a factor label that I need to use as factor on a xyplot. Probably
this was already solved so can I get the place where I can look for?
Thanks,
Hugo
[[alternative HTML version deleted]]