Displaying 20 results from an estimated 2000 matches similar to: "lattice and fitted function error"
2003 Apr 09
3
Reading in multiple files
I apologize if this is a FAQ -- I kind of recall seeing something along
these lines before, but I couldn't find the message when I searched the
archives.
Problem:
1. I have hundreds of small files in a subdirectory ("c:\\temp") and I would
like to combine the files into a single data frame.
2. Individually, it is easy to read each file
2008 Oct 03
1
question on xyplot
Hi List,
I have the following problem: I am using the multilevel package and make.univ function for available in the package and then xyplot from lattice and I want to know how could I be able to use the ?coefficient? for the straight line that passes the data ?
Example from help:
library(multilevel)
data(univbct) #a data set already in univariate or stacked form for job satisfaction
2002 Oct 08
2
Orthogonal Polynomials
Looking to the wonderful statistical advice that this group can offer.
In behavioral science applications of stats, we are often introduced to
coefficients for orthogonal polynomials that are nice integers. For
instance, Kirk's experimental design book presents the following
coefficients for p=4:
Linear -3 -1 1 3
Quadratic 1 -1 -1 1
Cubic -1 3 -3 1
In R orthogonal
2002 Oct 09
1
Summary Orthogonal Polynomials
As usual, the R newsgroup set me straight (thanks to Douglas Bates, Robert
Balshaw and Albyn Jones).
There is really no difference between using orthogonal polynomials of the
form:
Linear -3 -1 1 3
Quadratic 1 -1 -1 1
Cubic -1 3 -3 1
Versus
> poly(c(1:4),3)
1 2 3
[1,] -0.6708204 0.5 -0.2236068
[2,] -0.2236068 -0.5 0.6708204
[3,] 0.2236068
2002 Nov 21
0
Analysis of Data with Observation Weights Revisited
In lm and glm, the weights command should only be used when the variances of
the observations are inversely proportional to the weights.
Recently, however, a question came up regarding how one could estimate lm
and glm models with weights where the weights refer to number of
observations (counts).
Because lm and glm do not handle this case, SE values will be wrong if one
uses the weight command
2003 Mar 03
0
lm, gee and lme
Behavioral science data is often collected from nested structures (students
in schools, in districts, etc.). This can produce nonindependence among
responses from individuals in the same groups. Consequently, researchers
are advised to model the nested nature of the data to avoid biases in SE
estimates.
Failing to account for nonindependence can lead to SE estimates that are too
large or too
2003 Feb 01
1
matrix subscripts in replacement
I'm reluctant to draw the S-PLUS and R comparison (these are different
programs after all), but could someone tell me why the following matrix
substitution works in S-PLUS, but not R. I'm curious because matrix
substitution is a really slick way to "cleaning up" columns of data in data
frames. For example, in the following I change values of 1 to values of 10,
but only for
2001 Apr 28
9
two new packages
I've prepared preliminary versions of two packages that I plan eventually
to contribute to CRAN:
car (for "Companion to Applied Regression") is a package that provides a
variety of functions in support of linear and generalized linear models,
including regression diagnostics (e.g., studentized residuals, hat-values,
Cook's distances, dfbeta, dfbetas, added-variable plots,
2001 Apr 28
9
two new packages
I've prepared preliminary versions of two packages that I plan eventually
to contribute to CRAN:
car (for "Companion to Applied Regression") is a package that provides a
variety of functions in support of linear and generalized linear models,
including regression diagnostics (e.g., studentized residuals, hat-values,
Cook's distances, dfbeta, dfbetas, added-variable plots,
2001 Apr 28
9
two new packages
I've prepared preliminary versions of two packages that I plan eventually
to contribute to CRAN:
car (for "Companion to Applied Regression") is a package that provides a
variety of functions in support of linear and generalized linear models,
including regression diagnostics (e.g., studentized residuals, hat-values,
Cook's distances, dfbeta, dfbetas, added-variable plots,
2003 Oct 17
1
as.matrix does not turn data frame into character matrix
The as.matrix function behaves in a puzzling manner. The help file says:
"`as.matrix' is a generic function. The method for data frames will
convert any non-numeric column into a character vector using
`format' and so return a character matrix."
But this does not appear to be the case in the following example. Instead,
as.matrix turns a data.frame into a list, not a
2003 May 30
2
Extracting Vectors from Lists of Lists Produced by Functions
If you found my subject heading to be confusing then I'm sure you'll enjoy
the example I've included below. I find the apply type functions to be
wonderful for avoiding loops but when I use them with existing functions, I
end up using loops anyway to extract the vectors I want. I would appreciate
it if someone could show me how to avoid these loops. Thanks.
EXAMPLE:
2006 Jun 28
1
Simulate dichotomous correlation matrix
Newsgroup members,
Does anyone have a clever way to simulate a correlation matrix such that
each column contains dichotomous variables (0,1) and where each column
has different prevalence rates.
For instance, I would like to simulate the following correlation matrix:
> CORMAT[1:4,1:4]
PUREPT PTCUT2 PHQCUT2T ALCCUTT2
PUREPT 1.0000000 0.5141552 0.1913139 0.1917923
PTCUT2
2004 Sep 21
2
Bootstrap ICC estimate with nested data
I would appreciate some thoughts on using the bootstrap functions in the
library "bootstrap" to estimate confidence intervals of ICC values
calculated in lme.
In lme, the ICC is calculated as tau/(tau+sigma-squared). So, for instance
the ICC in the following example is 0.116:
> tmod<-lme(CINISMO~1,random=~1|IDGRUP,data=TDAT)
> VarCorr(tmod)
IDGRUP = pdLogChol(1)
2006 Jan 05
4
ylim problem in barplot
R Version 2.2.0
Platform: Windows
When I use barplot but select a ylim value greater than zero, the graph
is distorted. The bars extend below the bottom of the graph.
For instance the command produces a problematic graph.
barplot(c(200,300,250,350),ylim=c(150,400))
Any help would be appreciated.
Paul
[[alternative HTML version deleted]]
2009 Oct 23
1
making a plot in xyplot
Hello,
I am a newbie to the lattice package in R, and I'm trying to make a plot using the xyplot function. I have repeated measures data (2 conditions) for two different groups of subjects (teens and adults).
So far, I've made a basic graph using xyplot(y ~x, group=subnum, data=mydata, type="b").
Now I would like to make all the teens' lines one color and the adults'
2003 Sep 24
2
probit analysis for correlated binary data
Dear all,
I have a question on the dose-response estimation with clustered/ correlated binary data.
I would like to estimate the hit rate for a certain test at various concentration levels. The test is used
on 5 subjects, and each subject is tested 20 times. If we assume that the 100 samples are
independent, the hit rate estimate is unbiased, but the variance is under-estimated. The other
2005 May 31
3
lars / lasso with glm
We have been using Least Angle Regression (lars) to help identify
predictors in models where the outcome is continuous. To do so we have
been relying on the lars package. Theoretically, it should be possible
to use the lars procedure within a general linear model (glm) framework
- we are particular interested in a logistic regression model. Does
anyone have examples of using lars with logistic
2010 Jan 18
1
a question about "multilevel"model
Hello all:
I've read the document named "A Brief Introduction to R, the multilevel package and the nlme package".
At p68, one can transform the dataset to the required format by using "make.univ".
I wanna know,how the new variable "MULTDV" is calculated(can you show me the formula if possible please?)?And what's the usage of this new variable in the following
2005 Sep 09
2
Simulate phi-coefficient
Looking for help with the following problem.
Given a sample of zeros and ones, for example:
> VECTOR1<-rep(c(1,0),c(15,10))
> VECTOR1
[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
How would I create a new sample (VECTOR2) also containing zeros and
ones, in which the phi-coefficient between the two sample vectors was
drawn from a population with a known