similar to: Reading in data

Displaying 20 results from an estimated 40000 matches similar to: "Reading in data"

2011 Mar 07
1
XYPLOT - GROUPING WITH TWO CATEGORICAL VARIABLES
Hi! I have a dataframe like this: dat=data.frame(Age=c(rep(30,8),rep(40,8),rep(50,8)),Period=rep(seq(2005,2008,1),3),Rate=c(seq(1,8,1),seq(9,16,1),seq(17,24,1)),Sex=rep(c(rep(0,4),rep(1,4)),3))attach(dat)dat    Age Period Rate Sex1   30   2005    1   02   30   2006    2   03   30   2007    3   04   30   2008    4   05   30   2005    5   16   30   2006    6   17   30   2007    7   18   30   2008  
2009 Nov 12
1
XML: Reading transition matrices into R
Hello, from a software I have the following output in xml (see below): It is a series of matrices, for each age one. I have 3 categories (might vary in the application), hence, 3x3 matrices where each element gives the probability of transition from i to j. I would like read this data into R (preferably in a list, where each list element is one of the age specific matrices) and - after altering
2008 Feb 12
1
Finding LD50 from an interaction Generalised Linear model
Hi, I have recently been attempting to find the LD50 from two predicted fits (For male and females) in a Generalised linear model which models the effect of both sex + logdose (and sex*logdose interaction) on proportion survival (formula = y ~ ldose * sex, family = "binomial", data = dat (y is the survival data)). I can obtain the LD50 for females using the dose.p() command in the MASS
2005 Mar 11
1
reading in data problems
Hi I have a dataset (.txt file and .dat file) in which the length of one record is 144. There is no header in the .txt or .dat file itself. When I read this file using the read.table command, and want to drop some coloumns by setting the argument colClasses to "NULL" for the columns that I want to drop, it does not work, because the entire record of the length 144 is being treated as
2010 Aug 24
0
mlm for within subject design
Thank you for reading. I am trying to get sphericity values, and I understood I need to use mlm, but how do I implement a nested within subject design in mlm? I already read the R newsletter, fox chapter appendix, EZanova, and whatever I could find online. My original ANOVA anova(aov(resp ~ sucrose*citral, random =~1 | subject, data = p12bl, subset = exps==1)) Or anova(aov(resp ~
1999 Jul 01
1
lme
I am using rw0641. In my continuing quest to understand repeated measures analysis, I again return to lme. I exported the Potthoff and Roy data Orthodont.dat from S-PLUS 4.5 to avoid capture errors and ran the examples in the R help. I imported the data.frame with data <- read.table("Orthodont.dat",header=T) attach(data) and created the objects Orthodont.fit1 <-
2005 Mar 07
1
generalised linear models
To whom this may concern, I would be very grateful if someone could give me some advice on where I am going wrong with a logistic regression I am trying to run. I am trying to run a logistic regression on an aggregated data set and have input the command: logistic.mod<-glm(x~Frequency+Location+Sex+Age.Group,family=binomial(link="logit"),data=earsag1.dat) where x is the count of my
2008 Feb 19
1
Change the color and lines of the legend using bwplot
Dear list, I have following plot, where I have set the color (red and green) and lines (lty=2:3) in the panel.groups but can't not figure out how change the lines and color of the legend in the "key" to the same lines and color as in the panel.groups. bwplot(means ~ age | scales , dat, panel = "panel.superpose", groups = sex,scales = list(x = list(rot =
2004 Aug 19
3
List dimention labels to plots of components
It is frustrating to see the labels I want in the dimensions of a list but not be able to extract those labels into titles for plots generated from component objects. If someone could set me straight, I would appreciate it. For your amusement, I have provided an example of the Byzantine code I am currently using to avoid loops: # Simulate ANOVA type test data sex<-c(rep(1,8),rep(0,8))
2004 Dec 02
7
A possible way to reduce basic questions
Jim Lemon <bitwrit <at> ozemail.com.au> writes: > I have been thinking about how to reduce the number of basic questions that > elicit the ...ahem... robust debate that has occurred about how to answer The traffic on r-help could be reduced by creating a second list where more elementary questions are asked. There may be other ways to partition the universe of questions
2004 Jul 12
2
lme unequal random-effects variances varIdent pdMat Pinheiro Bates nlme
How does one implement a likelihood-ratio test, to test whether the variances of the random effects differ between two groups of subjects? Suppose your data consist of repeated measures on subjects belonging to two groups, say boys and girls, and you are fitting a linear mixed-effects model for the response as a function of time. The within-subject errors (residuals) have the same variance in
2009 Feb 23
1
"autonumber" for grouping variable
Dear R users, my dataframe looks like this head(dat) Id sex byear age 1 300 m 2003 50 2 300 m 2003 36 3 402 f 2003 29 4 402 f 2003 21 5 402 f 2003 64 6 150 m 2005 43 ... ...(where Id is just the Identification number of Individual, sex (male or female), byear (=birthyear)) now, I 'd like to add a column, where each Individual gets an automated number starting
2010 Jul 31
3
I have a problem
dear£º in the example£¨nomogram£©£¬I don't understand the meanings of the program which have been marked by red line.And how to compile the program(L <- .4*(sex=='male') + .045*(age-50) + (log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male'))). n <- 1000 # define sample size set.seed(17) # so can reproduce the results age <- rnorm(n, 50, 10)
2012 Oct 05
1
Error in lmer: asMethod(object) : matrix is not symmetric [1, 2]
Dear R Users, I am having trouble with lmer. I am looking at recombinant versus non recombinant individuals. In the response variable recombinant individuals are coded as 1's and non-recombinant as 0's. I built a model with 2 fixed factors and 1 random effect. Sex (males/females) is the first fixed effect and sexual genotype (XY, YY, WX and WY) the second one. Sexual Genotype is
2007 Aug 02
1
Xyplot - adding model lines to plotted points
Hello, I have written code to plot an xyplot as follows: library(lattice) xyplot(len~ageJan1|as.factor(cohort),groups=sex,as.table=T,strip=strip.c ustom(bg='white',fg='white'),data=dat, xlab="Age (January 1st)",ylab="Length (cm)",main="Linear models for male and female cod, by cohort",type='p',
2010 Aug 20
1
xyplot plot with groups
Hi, I am a beginner of xyplot() (or lattice package). On one hand, I immediately realized it's a very powerful utility. On the other hand, there are too many things for me to learn. Still haven't figure out a generalization of the syntax and usage under many different circumstances. Let me give an example dataset:
2009 Jan 19
1
further notes on model.frame issue
This is a follow-up on my note of Saturday. Let me start with two important clarifications - I think this would be a nice addition, but I've had exactly one use for it in the 15+ years of developing the survival package. - I have a work around for the current case. Prioritize accordingly. The ideal would be to change survexp as follows: fit <- survexp( ~ gender,
2010 Jan 10
1
xmlToDataFrame#Help!!!#follow-up
Dieter Menne pointed out that the (small) xml attachment didn't make it. Here is an in-line version (see end of message). Let's hope it works this time. I'm struggling with interpreting XML files created by ADODB as data.frames and I'm looking for advice. Note: This xlm contains a result set which comes from a rectangular data array. I've been trying to play with
2007 Sep 24
0
longitudinal imputation with PAN
Hello all, I am working on a longitudinal study of children in the UK and trying the PAN package for imputation of missing data, since it fulfils the critical criteria of taking into account individual subject trend over time as well as population trend over time. In order to validate the procedure I have started by deleting some known values ?we have 6 annual measures of height on 300 children
2003 Jul 14
2
problem with coding for 'optim' in R
Hi, there I am a graduate student new to coding in S who is hitting a bit of a wall at present using an "optim" function. I am running into some troubles, and was hoping someone might be able to recognize where I am going wrong. As background: I have constructed a loop that carries out a 365-day calculation for a mass-balance model. Basically, the model depends on 2 variables (p,