similar to: loop through variable names

Displaying 20 results from an estimated 120 matches similar to: "loop through variable names"

2012 Dec 06
1
scope, lme, ns, nlme, splines
I want to fit a series of lme() regression models that differ only in the degrees of freedom of a ns() spline. I want to use a wrapper function to do this. The models will be of the form y ~ ns(x, df=splineDF) where splineDF is passed as an argument to a wrapper function. This works fine if the regression function is lm(). But with lme(), I get an error. fitfunction() below demonstrates this.
2007 Jan 26
1
bootstrap bca confidence intervals for large number of statistics in one model; library("boot")
Sometimes one might like to obtain pointwise bootstrap bias-corrected, accelerated (BCA) confidence intervals for a large number of statistics computed from a single dataset. For instance, one might like to get (so as to plot graphically) bootstrap confidence bands for the fitted values in a regression model. (Example: Chiu S et al., Early Acceleration of Head Circumference in Children with
2002 Sep 09
1
getting variable names into formulas
Hello, I have a dataframe with several hundred variables. I would like to explore updates of some baseline lme fit by including each of some subset of these variables, one at a time. For various reasons it is inconvenient to rely on the positions of the numbered columns in the dataframe. Here is what I want to do: mod.baseline<-lme(fixed=foo,data=dat,random=bar) for(thisvar in vars){
2004 Nov 30
4
adding regression curve to xyplot
Dear R-listers, It seems that predict() behaves differently within panel.xyplot. Am I doing something stupid? Thanks, Carlisle First, without xyplot(): > lmtest <- lm(t~s,data=subset(P100,whichLon100==1 & whichLat100==1)) > lmtest Call: lm(formula = s ~ t, data = subset(P100, whichLon100 == 1 & whichLat100 == 1)) Coefficients: (Intercept) t 33.3307
2009 Sep 16
1
re-code missing value
Dear all, I have partial data set with four colums. First column is "site" with three factors (i.e., A, B, and C). From second to fourth columns (v1 ~ v3) are my observations. In the observations of the data set, "." indicates missing value. I replaced "." with NA. To replace "." with NA, I used two steps. First, I replaced "." with NA, and
2010 Nov 09
5
Question regarding to replace <NA>
Dear r-users, Basically, I have a data as follows, > data S s1 s2 s3 s4 s5 prob obs num.strata 1 NNNNN N N N N N 0.0000108 32 <NA> 2 NNNNY N N N N Y 0.0005292 16 <NA> 3 NNNYN N N N Y N 0.0005292 24 <NA> 4 NNNYY N N N Y Y 0.0259308 8 1 .... I want to replace <NA> by 0, when I tried the following
2012 Sep 26
3
replace string values with numbers
Hi everyone, I have a data frame Gene with SNPs eg. P1 P2 P3 CG CG GG -- -- AC -- AC CC AC -- AC I tried to replace all the GG with a value 3. Gene[Gene=="GG"]<-3 It always give me: Warning in `[<-.factor`(`*tmp*`, thisvar, value = 3) : invalid factor level, NAs generated Does any know if there is anything wrong with my code? Thanks, Zhengyu
2006 Aug 01
4
Fitting models in a loop
If I want to display a few polynomial regression fits I can do something like for (i in 1:6) { mod <- lm(y ~ poly(x,i)) print(summary(mod)) } Suppose that I don't want to over-write the fitted model objects, though. How do I create a list of blank fitted model objects for later use in a loop? Murray Jorgensen -- Dr Murray Jorgensen
2011 May 27
0
Wine release 1.3.21
The Wine development release 1.3.21 is now available. What's new in this release (see below for details): - Support for installation rollbacks in MSI. - 8- and 16-bit bitmap formats in the DIB engine. - Fixes in the XInput2 mouse support. - Better support for text shaping in Uniscribe. - Improvements to the Item common dialog. - More MSVC runtime functions. - Various bug fixes.
2009 Aug 05
4
multiple lty on same panel in xyplot
I would like to use lattice graphics to plot multiple functions (or groups or subpopulations) on the same plot region, using different line types "lty" or colors "col" to distinguish the functions (or groups). In traditional graphics, this seems straightforward: First plot all the data using 'type="n"', and subsequently execute a series of "points"
2003 May 30
2
color in plot title: title(sub="something", col=4)
Is there a way to specify the color of the main title, the subtitle, or the axis labels? I mean, for instance, something like title(main="cougar", col=2) For me, the above command produces the color black; that is, the "col" argument has no effect. I'm on a Windows 2000 machine with > version _ platform i386-pc-mingw32 arch i386 os mingw32 system
2003 Nov 04
5
read.spss Error reading system-file header
Is there any documentation on what kind of SPSS file can and cannot be read by read.spss? Alternatively, how can one modify or "clean" an SPSS file to make it readable by read.spss? What properties must a *.sav file before read.spss can read it? The file in this example is 270KB, with 5 rows and 173 columns. I have no trouble reading larger files with read.spss, so it's not
2009 Oct 12
3
xyplot does not find variable in data
When we call a lattice function such as xyplot, to what extent does the "data" designation cause the function to look inside the "data" for variables? In the examples below, the "subset" argument understands that "Variety" is a variable in the data. But the "scales" argument does not understand that "nitro" is a variable in the data.
2009 Sep 14
2
symbols(x,y, circles=sqrt(N)) with lattice xyplot
How would I create the following plot using lattice? symbols( combPsummary$pastRate, combPsummary$finRate, circles=sqrt(combPsummary$N) ) The idea is to plot finRate vs pastRate using circles whose areas are proportional to the number of people in each group. The following attempt does not really work: xyplot( finRate ~ pastRate , data=combPsummary , panel=function( x, y,
2013 Dec 02
2
plus/minus +/- in factor; not plotmath not expression
I want to put the "plus or minus" symbol into a character variable, so that this can be turned into a factor and be displayed in the "strip" of a faceted ggplot2 plot. A very nice solution, thanks to Professor Ripley's post of Nov 16, 2008; 3:13pm, visible at http://r.789695.n4.nabble.com/Symbols-to-use-in-text-td874239.html and subsequently
2004 Jul 23
2
lme4 groupedData is missing
help.search("groupedData") says that it's part of the lme4 package, but it appears not to be there (details below). Is this because lme4 is new and (perhaps) still under development? > update.packages() trying URL `http://cran.r-project.org/bin/windows/contrib/1.9/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 19113 bytes opened URL downloaded 18Kb >
2004 Aug 19
6
Is R good for not-professional-statistician, un-mathematical clinical researchers?
Alternate title: How can I persuade my students that R is for them? Alternate title: Can R replace SAS, SPSS or Stata for clinicians? I am teaching introductory statistics to twelve physicians and two veterinarians who have enrolled in a Mentored Clinical Research Training Program. My course is the first in a sequence of three. We (the instructors of this sequence) chose to teach R rather than
2009 Jul 26
1
obtain names of variables and data from glm object
Suppose we have some glm object such as: myglm <- glm( y ~ x, data=DAT) Is there an elegant way--or the "right way" within the R way of thinking--to obtain the names of the response variable, the predictor variables, and the dataset, as character strings? For instance, suppose the "right way" was to use the (currently fictitious) functions theresponse(), thepredictors(),
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
2010 Mar 04
2
fisher.test gives p>1
The purpose of this email is to (1) report an example where fisher.test returns p > 1 (2) ask if there is a reliable way to avoid p>1 with fisher.test. If one has designed one's code to return an error when it finds a "nonsensical" probability, of course a value of p>1 can cause havoc. Example: > junk<-data.frame(score=c(rep(0,14), rep(1,29), rep(2, 16))) >