Displaying 20 results from an estimated 4000 matches similar to: "puzzle about contrasts"
2008 Oct 23
1
Fw: It 's correct to do contrasts for a GLM?
Hi all
I am one recent user of R and have a few doubts
I did a binomial GLM with 3 - factor and now I have to test contrasts to
identify that treatments are different. I know that the contrasts are used
in ANOVA, it is not incorrect to use them in GLM? there is a way to do
contrasts between treatments for GLM as a Tukey for the ANOVA?
Susana
2008 Oct 16
1
packages in Depends field and NAMESPACES
Must packages in the Depends field of the DESCRIPTION file have
NAMESPACES? I haven't seen this explicitly indicated anywhere.
I am writing a small package and find that when I add the abind
package to the list of the Depends field, I get an error in
R CMD check of the build.
* checking package name space information ... OK
* checking package dependencies ... ERROR
Packages required but not
2007 May 30
2
runif with weights
Dear all,
I would like to generate 25 numbers from 1 to 100 but I would like to have some numbers that could be more probable to come out. I was thinking of the function runif:
runif(25, 1, 100) , but I don?t know how to give more weight to some numbers.
Example:
each number from 2 to 10 has the probability of 40% to come out but the probability of each number from 11 to 100 to come out is
2007 Mar 11
1
using scan to record user's input
I'm using scan in a script to record a series of responses of the user as
a function
of some graphs that I put up on the screen. A toy version would be,
y <- rep(NA, 3)
for (ix in seq( length(y) ) ) {
y[ix] <- scan( n = 1 )
}
However, if I include any code after this loop, for example,
y <- rep(NA, 3)
for (ix in seq( length(y) ) ) {
y[ix] <- scan( n = 1 )
}
y
I get an error
2008 Jun 23
2
grouping values
I tried aggregate, apply etc, but can't get the right result.
For example,
m <- cbind(c(LETTERS[1:5]), c("aa", "bb", "cc", "aa", "cc")) [,1] [,2][1,] "A" "aa"[2,] "B" "bb"[3,] "C" "cc"[4,] "D" "aa"[5,] "E" "cc"
how to obtain
2008 Jul 15
5
counting number of "G" in "TCGGGGGACAATCGGTAACCCGTCT"
Any better solution than this ?
sum(strsplit("TCGGGGGACAATCGGTAACCCGTCT", "")[[1]] == "G")
_________________________________________________________________
[[alternative HTML version deleted]]
2007 Sep 03
3
plotting predicted curves with log scale in lattice
Hi,
I was taken off guard by the following behavior in a lattice plot.
I frequently want to add a predicted curve defined at more
points than in the formula expression of xyplot. There have
been numerous examples of how to do this on r-help, but I
still often struggle to make this work. I just realized that
specifying one of the axes on a log scale does not guarantee
that the added data for a
2009 Jan 23
4
glm binomial loglog (NOT cloglog) link
I would like to do an R glm() with
family = binomial(link="loglog")
Right now, the cloglog link exists, which is nice when the data have a
heavy tail to the left. I have the opposite case and the loglog link
is what I need. Can someone suggest how to add the loglog link onto
glm()? It would be lovely to have it there by default, and it
certainly makes sense to have the two opposite
2009 Feb 02
2
parsing problem
Hi all,
I am trying to parse a vector for caliculating minimum in that vector the
vector having values like
1 Kontrolle
2 Placebo
3 125mg/kg
4 250mg/kg
5 500mg/kg
6 1000mg/kg
hear i tries for comverting it into numeric with using "as.numaric()"
function
but i got values like
5
6
2
3
4
1
it gives 1000mg/kg is the least one
but i have
2008 Dec 02
3
boxplot via plot command
Hi folks,
I've just discovered that the following code leads to boxplot (surprisingly to me).
Can anybody explain to me why? Is this documented somewhere? I've never
consider this option before.
x <- rnorm(300)
l <- c(rep("label1",100), rep("label2",50), rep("label3",150))
df <- data.frame(as.factor(l), x)
plot(df)
Thank you!
Antje
2007 May 29
0
new packages psyphy and MLDS
New packages psyphy and MLDS are available on CRAN:
psyphy ncludes an assortment of functions
useful in analyzing data from pyschophysical experiments. It
includes functions for calculating d' from several
different experimental designs, links for mafc to be
used with the binomial family in glm (and possibly
other contexts) and selfStart functions for estimating gamma values
2007 May 29
0
new packages psyphy and MLDS
New packages psyphy and MLDS are available on CRAN:
psyphy ncludes an assortment of functions
useful in analyzing data from pyschophysical experiments. It
includes functions for calculating d' from several
different experimental designs, links for mafc to be
used with the binomial family in glm (and possibly
other contexts) and selfStart functions for estimating gamma values
2007 Mar 17
1
problem with mfg argument of par
I'm having a problem with the mfg option of par. Am I making an error in my
usage? Here is a simple example that I thought would plot to the 4 corners
of a 2x2 plot but doesn't plot to the lower right and plots twice on the
upper left.
par(mfrow = c(2, 2))
pos <- as.matrix(expand.grid(1:2, 1:2))
for (ix in 4:1) {
par(mfg = pos[ix, ])
plot(1:5)
}
Thank you in advance.
R version
2009 Jan 23
2
R for Computational Neuroscience?
Hi all,
I've noticed that many computational neuroscience research groups use
MATLAB. While it's possible that MATLAB may have some features
unavailable in R, I suspect that this may instead simply be a case of
costly tradition, where researchers were taught MATLAB as students and
pay for it as researchers because it's all they know.
I'd like to attempt to break the cycle by
2007 Sep 01
1
Sweave rendering of simple character
Hi,
When I compile the construction
\begin{Scode}{eval=FALSE}
?HSP
\end{Scode}
with Sweave and latex, it outputs in the pdf as,
> `?` (HSP)
which is not incorrect but a bit more formal than I wanted
for demonstrating the use of the help shortcut.
I would like the output to look like,
> ?HSP
but I can't seem to make this work.
I have also tried the results=verbatim argument.
2009 Jan 16
2
Predictions with GAM
Dear,
I am trying to get a prediction of my GAM on a response type. So that I
eventually get plots with the correct values on my ylab.
I have been able to get some of my GAM's working with the example shown
below:
*
model1<-gam(nsdall ~ s(jdaylitr2), data=datansd)
newd1 <- data.frame(jdaylitr2=(244:304))
pred1 <- predict.gam(model1,newd1,type="response")*
The problem I am
2007 May 21
3
Selecting complementary colours
Dear r-helpers,
I wonder whether, given the "#rrggbb" representation of a colour, there is a
simple way to select the complementary colour, also expressed as a "#rrggbb"
string.
Any suggestions would be appreciated.
John
--------------------------------
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
2008 Nov 08
3
Fitting a modified logistic with glm?
Hi all,
Where f(x) is a logistic function, I have data that follow:
g(x) = f(x)*.5 + .5
How would you suggest I modify the standard glm(..., family='binomial')
function to fit this? Here's an example of a clearly ill-advised attempt to
simply use the standard glm(..., family='binomial') approach:
########
# First generate some data
########
#define the scale and location of
2007 Feb 11
2
Suppresing default text in pairs.lmList() in package = nlme
I would like to suppress the text 'Scatter Plot Matrix' that appears
under the plot. Could someone please suggest how?
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400 Charlottesville, VA 22904-4400
Parcels: Room 102 Gilmer Hall
McCormick Road Charlottesville, VA 22903
Office: B011
2007 Jun 11
3
if statement
Hi all,
I have a rather naive question. I have the height of 100 individuals in
a table and I want to assign the tallest 30% as Case=1 and the bottom
30% as Case=0. How do I do that?
thanks.
jiong
The email message (and any attachments) is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is