Displaying 20 results from an estimated 20000 matches similar to: "Weighted Regression"
2008 Aug 18
2
Using lag
Dear all,
I am having difficulties using the seemingly-simple function lag.
I have a dataframe with several weather variables (maxitemp,
windspeed, rainfall etc), and the response variable (admissions). The
dataset is fairly large (1530 observations). I simply want to model the
response against a lag of a couple of the explanatory variables, say
maxitemp and rainfall. I would like to look at
2008 Jul 30
2
Bizarre - R crashes on merge
Hi all,
I have a large data.frame, 1530 observation with 6 columns. I want to
merge a 7th column, a transformation of the response variable (hospital
admissions), namely
trans<-sqrt(copd$admissions+0.25)
trans<-data.frame(trans)
And now when I do
copd2<-merge(copd,trans)
(copd being my original data.frame), R either crashes or is taking an
extremely long time to do the computation. I
2008 Jul 21
1
Subsetting data by date
Hi all,
Firstly I appologise if this question has been answered previously,
however searching of the archives and the internet generally has not
yielded any results.
I am looking in to the effects of summer weather conditions
(temperature, humidity etc), on the incidences of a breathing disorder
brought on through smoking (COPD). I am fairly new to R and completely
new to the idea of
2008 Jul 24
4
Just 2 more questions - for now!
Hi all,
Thanks for the help with my previous post.
I have just two more questions for the minute.
I think I said in a previous post that I like to use the terminal,
i.e. run rterm.exe. On exiting the terminal, I am asked if I want to
save the workspace. If I hit y (yes), the workspace is just saved as
.rdata in my working directory, does anyone know how I can name it
directly from the
2008 Aug 21
4
Very confused with class
Hi all,
I am very confused with class.
I am looking at some weather data which I want to use as explanatory
variables in an lm. R has treated these variables as factors (i.e. with
different levels), whereas I want them treated as discretely measured
continuous variables. So I need to reassign the class of these
variables, right?
Indeed, doing
class(southwest$pressure)
(pressure being air
2012 Oct 26
0
combined output with zelig is not working!?!
Hi everyone,
I have carried out a multiple imputation in R using Amelia II and have
created 5 multiply imputed datasets. The purpose of my research is to fit a
Poisson Model to the data to estimate numbers of hospital admissions.
Now that I have 5 completed datasets and I have to pool all the 5 datasets
to get one combined output for a poisson model.
I have checked previous queries about
2007 Jun 11
0
Weighted least squares
As John noted, there are different kinds of weights, and
different terminology:
* inverse-variance weights (accuracy weights)
* case weights (frequencies, counts)
* sampling weights (selection probability weights)
I'll add:
* inverse-variance weights, where var(y for observation) = 1/weight
(as opposed to just being inversely proportional to the weight)
* weights used as part of an
2002 Jan 13
0
weighted regression: Osius & Rojek's test for logistic regression models
Dear all,
I am trying to implement goodness-of-fit tests for logistic regression
models described in : Hosmer, D.W., Lemeshow, S., 2000. Applied logistic
regression. New-York, John Wiley & Sons, Inc., 373 p. (pp. 152-154)
Namely I would like to reproduce Osius & Rojek's test (Osius, G., Rojek,
D., 1992. Normal goodness-of-fit tests for multinomial models with large
degrees of
2010 Jul 27
1
problem with zero-weighted observations in predict.lm?
In modelling functions some people like to use
a weight of 0 to drop an observation instead of
using a subset value of FALSE. E.g.,
weights=c(0,1,1,...)
instead of
subset=c(FALSE, TRUE, TRUE, ...)
to drop the first observation.
lm() and summary.lm() appear to treat these in the
same way, decrementing the number of degrees of
freedom for each dropped observation. However,
predict.lm() does
2008 Sep 05
1
Orthogonalization algorithms
Hi,
I have eight vectors that I would like to orthogonalize preferably
using R. The vectors are of considerable length, however due to their
nature I know they satisfy the conditions needed to apply the
Gram-Schmidt algorithm. Before I embark on some R coding, I wanted to
check that there is no facility / function already around that computes
the orthogonalized set of vectors? I have performed
2008 Aug 28
1
Renaming objects
Hi,
Is there any quick and easy way to rename a number of objects, without
having to rename each one individually and then remove the old one? And
if so, is there anything I can do to adjust the associated comments
accordingly?
Thanks for any help,
Robin Williams
Met Office summer intern - Health Forecasting
robin.williams@metoffice.gov.uk
[[alternative HTML version deleted]]
2008 Jul 24
4
Is there an equivalent * operator?
Hi all,
Is there an equivalent to the general * operator in R, where * can
represent any character?
I have a dataset, one column being date, date ranging between
April-September, 97-06. I would like to be able to acquire the data for
a specific month, say September, so that I can take average temperatures
for the month, etc. I thought I would be able to do something like
data.s1 <-
2008 Sep 08
3
Saving functions
Hi,
Appologies for the simple nature of this question, I am unable to find
the answer in manuals (EG and introduciton to R).
I have written a function in a text editor and saved it with an .R
extension. It is saved in my working directory. How can I run it, do I
need to use source? If so, how do I supply the arguments to the
function? Or does it need to be saved in a particular directory?
2008 Sep 04
2
Coefficient of skewness
Hi,
Is there a function in R to calculate the coefficient of skewness of
some data? I had expected there to be one, but can find no information
about it.
Thanks for any pointers.
Robin Williams
Met Office summer intern - Health Forecasting
robin.williams@metoffice.gov.uk
[[alternative HTML version deleted]]
2006 Aug 09
0
Weighted Mean Confidence Interval
Hello,
I'm looking to calculate a 95% confidence interval about my estimate for
a sample's weighted mean, where the calculated confidence interval would
equal the t-test confidence interval of the sample in the case when all
of the weights are equal.
My initial thought was to simply implement a modified version of the
t-test function but substituting the weighted variance and mean for the
2008 Aug 28
1
Singularity?
Hi all,
When using lm to model a response with 8 explanatory variables, one of
the variables is not defined due to "singularities". I have checked the
csv file from which the data come, there are no na's in the dataset,
etc. What should I be looking for in this variable to correct the
problem?
Thanks for any help.
Robin Williams
Met Office summer intern - Health Forecasting
2001 Nov 02
0
Applying lm() to weighted cell.means
Dear R,
We are seeking a version of summary.lm appropriate for a fit of cell means
(with specified weights and variance).
Imagine one had 5 observations from each of two groups and wished to test a
difference in means. A simple call to lm() and summary.lm() will return the
appropriate test:
raw.data <- data.frame(x = rep(0:1, rep(5, 2)), y = 1:10)
fit.raw <- lm(y ~ x, data=raw.data)
2008 Sep 09
2
How does predict.lm work?
Hi,
Please could someone explain how this element of predict.lm works?
From the help file
`
newdata
An optional data frame in which to look for variables with which to
predict. If omitted, the fitted values are used.
'
Does this dataframe (newdata) need to have the same variable names as
was used in the original data frame used to fit the model? Or will R
just look across consecutive
2003 Dec 19
2
weighted regression
To all
I have some simple questions pertaining to weights used in regression.
If the variability of the dependent variable (y) is a function of the magnitude of predictor
variable (x), can the use of weights give an appropriate answer to the regression parameters
and the std errors?
Assume that y at x=1 and 6 has a standard deviation of 0.1 and at x=11 it is 0.4
Then according to a web page on
2008 Jul 23
0
Fw: Using if, else statements
Sorry in the previos replay I forgot monday' scale
so weight should be:
weight <- c(0.91,1,1,1,1,1.21,1.22)
names(weight) <- c("mon","tue","wed","thu","fri","sat","sun")
----- Original Message -----
From: "Gabriela Cendoya" <gcendoya at balcarce.inta.gov.ar>
To: "Robin Williams" <>