Dear all,
I do have zipped data and want to use the package "ff".
Unfortunately I am not able to load the date:
When I try to use "ffload" I always get:
Error in system(cmd, intern = TRUE) : 'unzip' not found
Conferring to other R-help posts I already downloaded a software for
zipping/unzipping
Hello,
I am solving a set of ODEs using deSolve and have run into a problem I
would appreciate some advice on. One of the parameters (m) in the ODEs
changes between two states when one of the variables (D) crosses a
threshold (D_T) for the first time in either direction. Additionally, when
the var
Hi David,
Thank you for your suggestion- I will look into it some more.
Thanks again,
Hannah
On Wed, Apr 18, 2018 at 5:09 PM, David Winsemius
wrote:
>
> > On Apr 18, 2018, at 1:04 AM, Hannah Meredith
> wrote:
> >
> > Hello,
> >
> > I am solving a set of OD
better when I don't treat the sin covariate as cyclic, but that doesn't
seem appropriate to me, because a sin is naturally cyclic.
Any help is much appreciate, thank-you for your time!
Hannah
[[alternative HTML version deleted]]
_
Dear All,
I am trying to do an ancestral state reconstruction in R using the package
'ape'. I have tried trimming my tree in BayesTraits and in R itself, and the
resulting tree reports as having 573 species tips, which is the same as my
dataset. As far as I can tell everything is loading prop
Is there an easy way to make graphs for the following data. I have
pretest and posttest scores for men and
women. I would like to form a 'titlted segment' plot for the data.
That is, make segments joining the scores,
with different types of segments for men and women.
Example data:
menpre <- c(43
I'm not sure how to do this in lattice, but here is an option
with ggplot2.
library(ggplot2)
set.seed(123)
# Make sure the data has a variable that indicates
# which group is red and which one is black
DF <- data.frame(x = rnorm(10), y = rnorm(10), gr = rep(1:5,
2),endpoint = c(rep("Red_Group",5)
Hi Janet,
Were you able to install the package? I just installed it without
problems. I don't
think there should be any issues installing it. If it has not worked
yet, make sure your
R is updated, and if it is, maybe reinstall it.
Best,
Juliet
On Mon, Aug 17, 2009 at 8:43 PM, Janet
Rosenbaum wr
Is multinom the function you are looking for?
library(nnet)
library(MASS)
?multinom indicates that this
fits multinomial log-linear models. If you are looking for multiple
logistic regression
you may want to read up on glm or lrm from the Design package.
Could you elaborate on what you mean by a
Let's say that location defined a group, and observations may
be more similar in a group. You could account for this similarity
with the following model.
model1 <-lme(X~CorP,random=~1|location,data=mydata,method="ML")
This fits a random intercept model grouped by location. This would
assume that
Check out Chapter 7 of Laura Thompson's R Companion to Agresti (you can find it
online).
It will show you how to fit proportional odds models (polr in MASS,
and lrm in the Design library) and multinomial
regression models.
__
R-help@r-project.org mailin
You may find the multtest package helpful. It implements methods from
Westfall and Young (Resampling based multiple testing).
On Mon, Aug 31, 2009 at 5:37 AM, Yonatan
Nissenbaum wrote:
> Hi,
>
> My query is regarding permutation test and reshuffling of genotype/phenotype
> data
> I have been usi
I get a different result:
txt <- c("sales to 23 August 2008 published 29 August","sales to 6
September 2008 published 11 September")
strsplit(txt, 'published ', fixed=TRUE)
[[1]]
[1] "sales to 23 August 2008 " "29 August"
[[2]]
[1] "sales to 6 September 2008 " "11 September"
> sessionInfo()
R ve
Do you run into problems if you use something like:
cc <- rep("numeric",9)
mydata <- read.table("yourdata",header=TRUE,colClasses=cc,skip=1,nrows=numRows)
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read t
The test that a slope differs by group is a test that the
variable*group interaction equals
zero (overall test). Maybe searching post-hoc comparisons in
regression will give you some
leads.
On Tue, Sep 15, 2009 at 10:57 AM, Jun Shen wrote:
> Hi, all,
>
> I am thinking to compare a group of slopes
It would be easier with some example data. Make sure the data is represented by
factors and check the levels and relevel if needed. Something like:
df$day <- factor(df$day, levels = c("30", "29", "20))
Also search the ggplot2 mailing list for factor and order. I think
similar questions
are asked
I just installed it, and it worked fine.
> sessionInfo()
R version 2.10.1 (2009-12-14)
i386-pc-mingw32
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached ba
I didn't follow your question completely. But do a search for
intraclass correlation with nlme or lmer and see if those results
relate to the question you are asking. If so, I would
suggest following up on the mixed model list. I know you
wanted to avoid mixed models, but if I have understood
your
I use rms, lme4, ggplot2 frequently (also lattice and MASS).
On Tue, Mar 2, 2010 at 3:13 PM, Ralf B wrote:
> Hi R-fans,
>
> I would like put out a question to all R users on this list and hope
> it will create some feedback and discussion.
>
> 1) What are your 3 most useful R package? and
>
> 2)
Some code to cut and paste would be helpful. The following may help out.
library(multtest)
# create some p-values
p <- runif(100)
p <- sort(p)
p_adj <- mt.rawp2adjp(p, proc="BH", alpha = 0.05)
> str(p_adj)
List of 4
$ adjp : num [1:100, 1:2] 0.0142 0.0174 0.0254 0.0258 0.0736 ...
..- attr(*
Here are two things to try.
First check the data. There may be a factor that does not have
variation in the sample. For example,
if you had a predictor such as 'present'/'absent', in the current
sample, all of them
may be 'present'.
Second, you can put a 'try' statement in your function.
try(
Hi,
#make example data
dat <- data.frame(matrix(rnorm(15),ncol=5))
colnames(dat) <- c("ab","cd","ef","gh","ij")
If I want to get a subset of the data for the middle 3 columns, and I
know the names of the start column and the end column, I can do this:
mysub <- subset(dat,select=c(cd:gh))
If I w
Hi Group,
Create some example data.
set.seed(1)
wide_data <- data.frame(
id=c(1:10),
predictor1 = sample(c("a","b"),10,replace=TRUE),
predictor2 = sample(c("a","b"),10,replace=TRUE),
predictor3 = sample(c("a","b"),10,replace=TRUE),
measurement1=rnorm(10),
measurement2=rnorm
Hi Group,
I have a question about obtaining the bias-corrected c-index using
validate from the Design library.
As an example, consider the example from help page:
library(Design)
?validate.lrm
n <- 1000
age<- rnorm(n, 50, 10)
blood.pressure <- rnorm(n, 120, 15)
cholesterol<- rno
Here are a couple of examples.
# residuals not normal
n <- 100;
x = seq(n)
y = 10 + 10 *x + 20 * rchisq(n,df=2)
non_normal_lm = lm(y~x)
#non-constant variance
n <- 100;
x = seq(n)
y = 100 + 3 * x + rnorm(n,0,3) * x;
het_var_lm = lm(y~x)
#For each of these try:
plot(non_normal_lm)
plot(het_var_lm
Hi Jack,
Maybe this helps.
# make some data
set.seed(123)
condition <- factor(rep(c("a","b"), each = 5))
score <- rnorm(10);
lg <- data.frame(condition, score)
# Carry out commands
a <- subset(lg,condition=="a")["score"]
b <- subset(lg,condition=="b")["score"]
t.test(a,b,paired=TRUE)
#Error
Maybe this is helpful.
Install ggplot2.
#Create a small example
x <- seq(1:20)
y <- (2*x) + rnorm(length(x),0,1)
id <- rep(1:5,each=4)
dat <- data.frame(x,y,id)
library(ggplot2)
p <- ggplot(dat,aes(x=x,y=y,colour=factor(id)))
p <- p + geom_point()
p
If this is not the correct structure, maybe i
Hi List,
I have a question about uninstalling and installing R on linux, which
I am new to.
> sessionInfo()
R version 2.10.1 (2009-12-14)
x86_64-unknown-linux-gnu
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=C
>>
>> This has not worked for me, meaning I can still use R, so instead I
>> removed the directory
>>
>> rm -fR R-2.10.1
>>
>> Is one method preferable to another. And what am I doing incorrectly
>> with "make uninstall"?
>
> Don't know, probably not many are using it and it may be fairly untested.
I installed R 2.11.0, and I don't think I can load the doBy package
now. Any suggestions?
> library("doBy")
Loading required package: survival
Loading required package: splines
Error in loadNamespace(i[[1L]], c(lib.loc, .libPaths())) :
there is no package called 'Hmisc'
Error: package/namespace
I should have mentioned that I also tried:
> install.packages("Hmisc")
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘Hmisc’ is not available
On Fri, Apr 23, 2010 at 3:15 PM, David Winsemius wrote:
>
> On Apr 23, 2010, at 3:09 PM,
Does this work for you?
data_list <- list()
filepattern="modrate*"
all_files <- list.files(pattern=filepattern)
data_list <- lapply(all_files, read.table,header=TRUE,sep=",")
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-h
I think it's helpful to show the sampling variability in a QQ plot
under repeated
sampling. An example is given
in Venables, Ripley pg 86. The variance is higher at the tails. Even when the
distributions are the same, the QQ plot does not have to resemble a straight
line because of sampling. I don'
>
> Also, you probably get less data copying by using a for() or while() loop
> than by using apply() in this context.
Why may there be less data copying with "for" and "while" compared to apply?
>
> Finally, the overhead of formula parsing and model matrix construction
> repeated thousands of
Check out examples in the lattice package and ggplot2 package.
For example let's say you plot points and confidence intervals. These packages
will then allow you to plot these values by group and by combinations of groups.
Look up conditioning and faceting in these packages.
On Wed, Nov 18, 2009 a
Here are some options that may help you out. First,
let's put the data in a format that can be cut-and-pasted
into R.
myData <- read.table(textConnection("var1 var2 var3
1 111
2 312
3 813
4 614
51015
6 221
7 422
8
Your R code looks correct.
Because this is a straightforward calculation, I would be surprised if there
were any differences with SPSS. It may be worthwhile to check
if SPSS gives partial correlations or semipartial correlations. For example,
if you take the correlation between
py <- resid(lm(y
Hi List,
Here is some example data.
myDat <- read.table(textConnection("group id
1 101
1 201
1 301
2 401
2 501
2 601
3 701
3 801
3 901"),header=TRUE)
closeAllConnections()
corr_mat <-read.table(textConnection("1 1 .5 0 0 0 0 0 0 0
2 .5 1 0 0 0 0 0 0 0
3 00 1.0
One can use colClasses to set which columns get read in. For the
columns you don't
want you can set those to NULL. For example,
cc <- c("NULL",rep("numeric",9))
myData <- read.table("myFile.txt",header=TRUE,colClasses=cc,nrow=numRows).
On Wed, May 27, 2009 at 12:27 PM, wrote:
> We are reading
There are several things you can tell read.table to make it faster.
First, as mentioned, setting colClasses helps. I think telling read.table how
many rows and columns there are also helps.
When this was not sufficient, I've had to do the data processing
using Python, Perl, or awk.
If that had
Hi All,
I am trying to understand panel functions. Let's use this example.
library(lattice)
time<-c(rep(1:10,5))
y <-time+rnorm(50,5,2)
group<-c(rep('A',30),rep('B',20))
subject<-c(rep('a',10),rep('b',10),rep('c',10),rep('d',10),rep('e',10))
myData <-data.frame(subject,group,time,y)
head(myData)
You may find the following two books useful:
Lehmann, Reminiscences of a Statistician (Springer).
David Salsburg, The lady testing tea.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide h
Hi Group,
I posted this question on the ggplot list and was advised to try here
also. The code
below produces a plot as a png and pdf. The pdf looks great, and I cannot
make the png look this way. I've tried various combinations of
height, width, and dpi, but it has not worked out so
far. Any sug
Hi Group,
For the plot below, are there other ways I can use more of the
plotting space. I've tweaked the parameters I know of.
I could also put the plot titles inside the plot if there is a way to
do that. Thanks for your input. Regards, Juliet
p1 <- runif(1000) # sample data
qp1 <- qqmath(~ -l
Hi,
I have a line such as:
myline <- "0.10 1.5000 0.6000 538
0.369404"
and I would like to put the numbers into a vector. Some combination of
tabs and spaces occur between the numbers.
I tried:
try1 <- strsplit(myline,"[[:blank:]]+")
> try1
[[1]]
[1] ""
Hi,
I've been working with R for a couple of years, and I've
been able to get most of the things done that I needed (sometimes in
a roundabout way). A few experienced statisticians told me that
R is best for interactive data analysis, but for large-scale
computations, one needs something else.
I
Here is an example that may be helpful.
A <- matrix(c(-3,5,4,-2),nrow=2,byrow=TRUE)
eigs <- eigen(A)
eigs
$values
[1] -7 2
$vectors
[,1] [,2]
[1,] -0.7808688 -0.7071068
[2,] 0.6246950 -0.7071068
The eigenvectors may be scaled differently because they are not unique
(or have
Check out the help page of the lrm function in the rms library. To
show how lrm is used,
the examples simulate data for logistic regression. This may give you
some ideas.
On Wed, Jan 20, 2010 at 10:41 AM, omar kairan wrote:
> Hi,
>
> could someone help me with dilemma on the simulation of logisti
Hi Group,
Consider a data frame like this:
mylabel1 <- rep(c("A","B","C"),each=3)
mylabel2 <- rep(c("A","B","C"),3)
corrs <- c(1,.8,.7,.8,1,.7,.7,.7,1)
myData <- data.frame(mylabel1,mylabel2,corrs)
myData
mylabel1 mylabel2 corrs
1AA 1.0
2AB 0.8
3A
Check out the book
Linear Mixed Models: A Practical Guide Using Statistical Software by
Brady West.
It sets up analyses, similar to ones you described, in SPSS, R, and
others as well.
In general, I think it is good to know a couple of different packages,
especially
if you plan on doing a lot of
Hi Jan and Simon,
If possible, could you attach the diagnostic plots. I would be curious to
see them.
Thanks,
Juliet
On Fri, Apr 19, 2013 at 4:39 AM, jholstei wrote:
> Simon,
>
> that was very instructivevery special thanks to you.
> I already noticed that the model was bad, but it was not
Hi,
The acf function requires that you specify how to deal with NAs in your
data. By default, it uses na.fail ("Error in *na.fail.default*(as.ts(x)) :
missing values in object). Try using na.action=na.pass as an argument.
While this will pass over your NAs, make sure that you understand how that
w
All,
Can someone describe what
x[] <- lapply(x, as.numeric)
I see that it is putting the list elements into a data frame. The
results for lapply are a list, so how does this become
a data frame.
Thanks,
Juliet
On Mon, Dec 3, 2012 at 5:49 PM, Fisher Dennis wrote:
> Colleagues,
>
Because x[] keeps the dimensions, unlike just x.
>
> Hope this helps,
>
> Rui Barradas
> Em 06-12-2012 16:24, Juliet Hannah escreveu:
>
>> All,
>>
>> Can someone describe what
>>
>> x[] <- lapply(x, as.numeric)
>>
>> I see th
Is it correct that one does not need to escape special characters such as
"*" (are these
properly called metacharacters) inside []. If so, what is the logic to this?
mytest <- "he*llo"
sub("[*]","",mytest)
sub("\\*","",mytest)
[] is easier to read for me than \\. Is this what people tend to use?
I've used this package before, and it always gives me the message:
NOTE: THIS PACKAGE IS NOW OBSOLETE.
So I stopped using it. I just tried installing it and it gave me some
new errors (below). Maybe you should also post your sessionInfo().
> library("genetics")
Loading required package: combinat
You may find both of Alan Agresti's books on categorcial data analysis
useful. Try googling both books and then
search the word "grouped" within each book. Agresti refers to the
difference you describe as
grouped versus ungrouped data. The likelihoods differ and all
summaries based on the likelihoo
I have a data set that has 4 columns and 53860858 rows. I was able to
read this into R with:
cc <- rep("character",4)
myData <-
read.table("myData.csv",header=FALSE,skip=1,colClasses=cc,nrow=53860858,sep=",")
I need to reshape this data from long to wide. On a small data set the
following lines
> 'str' of it. If it is numeric, then the size of the object is
> probably about 1.8GB. Doing the long to wide you will probably need
> at least that much additional memory to hold the copy, if not more.
> This would be impossible on a 32-bit version of R.
>
> On Mo
.table() fails with out of memory. That is not
>> data.table
>> but unique. There is a change in unique.c in R 2.12 which makes unique
>> more
>> efficient and since factor calls unique, it may be necessary to use R
>> 2.12.
>>
>> If that still doesn't
Hi Group,
I have a matrix, and I would like to replace numbers less than 0 by
the smallest minimum number. Below is an
small matrix, and the loop I used. I would like to get suggestions on
the "R way" to do this.
Thanks,
Juliet
# example data set
mymat <- structure(c(-0.503183609420937, 0.1790
erkeley.edu
>
>
>
> On Thu, 15 Jul 2010, Juliet Hannah wrote:
>
>> Hi Group,
>>
>> I have a matrix, and I would like to replace numbers less than 0 by
>> the smallest minimum number. Below is an
>> small matrix, and the loop I used. I would like to get s
Hi Group,
I have a possibly naive question, but it seems like it fits into this
discussion.
I have observed that when researchers publish findings that are deemed
to be high-impact,
generous funding often follows.
R is used everywhere, and, of course, for many of these projects. So
my naive que
See if rowttests is any faster.
library(genefilter)
?rowttests
You have to install Bioconductor. I've used this on large datasets,
but I haven't compared
timings.
On Mon, Sep 13, 2010 at 4:26 PM, Alexey Ush wrote:
> Hello,
>
> I have a question regarding how to speed up the t.test on large dat
I think the most common reason to see different parameter estimates
with ordinal regression is that programs set up
the model differently.
For example, check out
library(MASS)
?polr
We see polr uses:
logit P(Y <= k | x) = zeta_k - eta
and notes that other software packages may use the opposite
Check out ggplot2, specifically geom_bar and geom_text.
http://had.co.nz/ggplot2/
You have to get used to its syntax, which can take some time, but
after that it can make things a lot easier. Here is an example.
library(ggplot2)
df <- data.frame(xvar = factor(c(1, 2)),
yvar = c(1, 5))
p <- ggp
Also check out the following post:
http://permalink.gmane.org/gmane.comp.lang.r.general/210897
On Sat, Nov 20, 2010 at 4:32 PM, casperyc wrote:
>
> Hi,
>
> I have count data
>
> x2=rep(c(0:3),c(13,80,60,27))
>
> x2
> 0 1 2 3
> 13 80 60 27
>
> I want to graph to be ploted as
>
> barplot(table
Make sure your data is a matrix. There are many examples of expression heatmaps
available on the bioconductor list. After checking out these examples, I would
post to the bioconductor list if you are still having problems. Also
consider a small
example to get you a working heatpmap. You have to ins
Here is some data (dput output below)
> myData
id group
1 D599 A
2 002-0004 B
3 F01932
You may want to check out examples in lattice and ggplot2. Both of
these make plotting subsets much easier. I can't remember the lattice
syntax off the top of my head, but if you post some example data –
either by creating it or using dput – people will be able to help out
easier. Here is some exa
Hi Jim,
I was trying to use your template without success. With the toy data
below, could
you explain how to use this template to change all "b"s to "z"s --
just as an exercise, reading
in 3 lines at a time. I need to use this strategy for a larger
problem, but I haven't
been able to get the basic
I have downloaded a file that I don't know how to describe correctly.
It contains R code and Latex, and I should be able to reproduce an
analysis by running an R script in this folder.
There is a line in the R script:
junk <- system(paste("/usr/texbin/pdflatex ",latexFiles[i1]),
Wow, it works! Thanks Erik. Your suggestion worked.
MikTek is indeed in the path, so I just modified the lines to:
junk <- system(paste("pdflatex ",latexFiles[i1]),
intern=TRUE)
On Sat, Aug 21, 2010 at 12:07 PM, Erik Iverson wrote:
> On 08/21/2010 11:02 A
Hi Group,
I have a data frame below. Within this data frame there are samples
(columns) that are measured more than once. Samples are indicated by
"idx". So "id1" is present in columns 1, 3, and 5. Not every id is
repeated. I would like to create a new data frame so that the repeated
ids are av
The 'findCorrelation' function in the caret package may be helpful.
On Tue, Apr 19, 2011 at 3:10 PM, Rita Carreira wrote:
>
> Hello R Users!
> I have a data frame that has many variables, some with missing observations,
> and some that are correlated with each other. I would like to subset the
# Let's say your expression data is in a matrix
# named expression in which the rows are genes
# and the columns are samples
myvars <- apply(expression,1, var,na.rm=TRUE)
myvars <- sort(myvars,decreasing=TRUE)
myvars <- myvars[1:200]
expression <- expression[names(myvars),]
dim(expression)
Also
I started with the summarized data, and there are different ways to do
this. For this example, let there be four columns and a corresponding
sum of 1s.
library("ggplot2")
mydf <- data.frame(colname = c("A","B","C","D"),mycolsum=c(1:4))
p <- ggplot(mydf,aes(x=colname,y=mycolsum))
p <- p + geom_bar
I am recoding some data. Many values that should be 1.5 are recorded
as 1-2. Some example data and my solution is below. I am curious about
better approaches or any other suggestions. Thanks!
# example input data
myData <- read.table(textConnection("id, v1, v2, v3
a,1,2,3
b,1-2,,3-4
c,,3,4"),head
What is the meaning of "\\1" here? Thanks.
desc <- c("hsa-let-7a MIMAT062 Homo sapiens let-7a","hsa-let-7a*
MIMAT0004481 Homo sapiens let-7a*","hsa-let-7a-2* MIMAT0010195 Homo
sapiens let-7a-2*")
I'm missing something:
> gsub(" MIMA.*", "\\1", desc)
[1] "hsa-let-7a""hsa-let-7a*" "hsa-l
It looks like the text didn't show assigning the results of factanal
to an object. Try:
pgdata<-read.table("pgfull.txt",header=T)
names(pgdata)
pgd<-pgdata[,1:54]
#missing line
model <- factanal(pgd,8)
par(mfrow=c(2,2))
plot(loadings(model)[,1],loadings(model)[,2],pch=16,xlab="Factor
1",ylab="Fac
GWAF uses the kinship package. The documentation is pretty good for
it, and I've used it successfully. It may be helpful to get that
working before trying automate some tasks using GWAF.
On Fri, Feb 4, 2011 at 2:20 PM, Jim Moon wrote:
> Hello, All,
>
> GWAF 1.2
> R.Version() is below.
>
> system(
If you could provide a small example of an actual data set (using
dput), you may get some suggestions
specific to your goals.
Here are a few examples of boxplots. If these look along the lines of
what you are looking for, you may want to search
the ggplot2 mailing list for more examples.
library(
Relatedness if often defined in terms of the kinship matrix. It may be
helpful to search for this. Several packages in R use this matrix
including the kinship package.
On Wed, Feb 16, 2011 at 3:14 PM, Val wrote:
> Hi all,
>
> I want to construct relatedness among individuals and have a look at th
If you can work with a different penalty check out the lrm function
from the rms package, which uses
penalized likelihood to fit proportional odds.
2011/3/24 Jheng-Jhong Wang :
> Dear R-users,
>
> I try to fit proportional odds ratio model "with LASSO" in
> ordinal regression.
> But I jus
Use exprs on the output from RMA (or another method you like)
library("affy")
myData <-ReadAffy()
myRMA <- rma(myData)
e = exprs(myRMA)
Also, check out the Bioconductor mailing list where
Bioconductor-related topics are discussed.
On Fri, Apr 1, 2011 at 9:54 AM, Landes, Ezekiel
wrote:
> I hav
Maybe the pedigree is not set up correctly. If this is the case, the
kinship matrix will not be constructed correctly. I see that in this
example,
the diagonal terms differ.
diag(kmat)
lmekin runs fine for me, and I can extract p-values with:
lmekinfit <- lmekin(...)
pval <- lmekinfit$ctab
As you mentioned, the deviance does not always reduce to:
D = -2(loglikelihood(model))
It does for ungrouped data, such as for binary logistic regression. So
let's stick with the original definition.
In this case, we need the log-likelihood for the saturated model.
x = rnorm(10)
y = rpois(10,l
I am trying to improve the look of an HTML table for a report (that
needs to be pasted into Word).
Here is an example.
table2 <- structure(c(26L, 0L, 40L, 0L, 10L, 0L, 0L, 188L, 0L, 281L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 4L), .Dim = c(6L, 3L), .Dimnames = structure(list(
myvar = c("Don't know", "S
In R, the output of xtabs displays the names of the dimnames. In the
example below, these are "change_diet" and "mydiet". Is there a way to
have xtable incorporate these names directly into the latex output.
Thanks for your help.
table2 <- structure(c(26, 0, 40, 0, 10, 0, 188, 0, 281, 0), .Dim =
Thanks for the suggestion, Duncan.
However, I was trying to maintain the contingency
table/cross-classification structure of the original table.
My use of xtable on this table, maintains the structure I want, but
the labels for the rownames and colum names is lost.
On Tue, Aug 16, 2011 at 11:0
Thanks to Duncan Mackay and Dennis Murphy for help.
The following solution seems to give me what I need.
library(memisc)
toLatex(ftable(cyl ~ am,data=mtcars))
For this to work, we have to use:
\documentclass{article}
\usepackage{booktabs}
\usepackage{dcolumn}
\begin{document}
at the beginning
I have a data set with about 6 million rows and 50 columns. It is a
mixture of dates, factors, and numerics.
What I am trying to accomplish can be seen with the following
simplified data, which is given as dput output below.
> head(myData)
mydate gender mygroup id
1 2012-03-25 F
;- function(d) length(rle(d$mygroup)$lengths) - 1
> ddply(myData, .(id), g) # gives the same answer as above
> myDT[, list(nswitch = length(rle(mygroup)$lengths) - 1), by = 'id'] # ditto
>
>
> HTH,
> Dennis
>
> On Wed, Aug 24, 2011 at 9:48 AM, Juliet Hannah
List,
Consider the following data.
gender mygroup id
1 F A 1
2 F B 2
3 F B 2
4 F B 2
5 F C 2
6 F C 2
7 F C 2
8 F D 2
9 F D 2
10 F D 2
11 F D 2
12 F
Help Workshop
was at the beginning.
With this, my attempts at package creation worked.
On Thu, Jun 30, 2011 at 12:51 PM, Juliet Hannah wrote:
> I am trying to build a package using windows xp. Here is the error I am
> getting:
>
> R CMD build myfunctions
>
> * checkin
I have a data frame in which missing values exist, and I need to
recode the string "missing" to a missing value. For the example, let's
assume I cannot do this while reading it in. Even though this has been
discussed extensively, I'm still a little confused about when to index
with "which" and when
I am trying to build a package using windows xp. Here is the error I am getting:
R CMD build myfunctions
* checking for file 'myfunctions/DESCRIPTION' ... OK
* preparing 'myfunctions':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checkin
See if the following thread
http://www.mail-archive.com/r-help@r-project.org/msg85070.html
and the paper cited in it are helpful. Terry Therneau provides code
for a Deming regression.
On Thu, Jul 7, 2011 at 12:58 PM, devon woodcomb wrote:
> Hi,
>
> I have a dataset which has var1 from 1 sours
I have a file in stata format, which I have read in, and I am trying
to create a text file. I have exported the data using various
delimiters, but I'm unable to read it back in. I originally read in
the file with:
library(foreign)
myData <- read.dta("mydata.dta")
I then exported it with write.tab
ius wrote:
>
> On Jul 12, 2011, at 4:37 PM, Juliet Hannah wrote:
>
>> I have a file in stata format, which I have read in, and I am trying
>> to create a text file. I have exported the data using various
>> delimiters, but I'm unable to read it back in. I original
1 - 100 of 157 matches
Mail list logo