search for: unweight

Displaying 20 results from an estimated 90 matches for "unweight".

Did you mean: nweight
2006 Mar 01
1
Drop1 and weights
Hi, If I used drop1 in a weighted lm fit, it seems to ignore the weights in the AIC calculation of the dropped terms, see the example below. Can this be right? Yan -------------------- library(car) > unweighted.model <- lm(trSex ~ (river+length +depth)^2- length:depth, dno2) > Anova(unweighted.model) Anova Table (Type II tests) Response: trSex Sum Sq Df F value Pr(>F) river 0.1544 1 3.3151 0.07100 . length 0.1087 1 2.3334 0.12911 depth 0.1917 1 4....
2007 Nov 26
1
Unweighted meta-analysis
...sent a set data from separate experimental studies, Treatment and Control, but no measure of the variance of effect sizes, numbers of replicates etc. Instead, for each study, all I have is the mean value for the treatment and control (but not the SD). As far as I can tell, this forces me into an unweighted meta-analysis, with all the caveats and dangers associated with it. Two possible approaches might be: a) Take the ln(treatment/control) and perform a Fisher's randomisation test (and also calculate +/- CI). b) Regress the treatment vs control values, then randomise (with or without replacem...
2010 Jul 20
1
Servreg $loglik
...ull density having right-censored observations. Some observations are weighted. To do that I regress the weighed observations against a column of ones. When I enter the data as 37 weighted observations, the parameter estimates are exactly the same as when I enter the data as the corresponding 70 unweighted observations. This is to be expected, of course. I don't understand, however, why the reported loglikelihood is > parameter.estimates$loglik [1] -120.4699 -120.4699 for the 37 weighted observations, but > parameter.estimates$loglik [1] -135.1527 -135.1527 for the 70 unweighted observ...
2008 Apr 28
0
weighted nonlinear fits: `nls' and `eval'
dear list, my question concerns the use of `eval' in defining the model formula for `nls' (version 2.6.2.). consider the following simple example, where the same model and data are used to perform unweighted and weighted fits. I intentionally used very uneven weights to guarantee large differences in the results #================================CUT=========================== ln <- 100 x <- 1:ln y0 <- exp(-.02*x) y <- rnorm(y0, y0, .01) wts <- rep(1, ln) y[...
2007 Aug 23
1
degrees of freedom question
...(log(Phi3)-log(r)-log(x))/exp(log(Phi4))) subject to the residual weighting Var(e[i]) = sigma^2 * abs( E(y) )^(2*Delta) Here is my question, in steps: 1. Function f1 is separately fitted to two different datasets corresponding to two different dose response curves. These fits are unweighted. 2. Function f2 is fitted to the pooled data such that the two dose response curves are assumed to differ _only_ in log(r). This fit is also unweighted. 3. The residuals from #2 are used to estimate an appropriate sigma^2 and Delta to use in weighting. 4. The functions descri...
2008 Jun 25
1
weighted inverse chi-square method for combining p-values
Hi, This is more of a general question than a pure R one, but I hope that is OK. I want to combine one-tailed independent p-values using the weighted version of fisher's inverse chi-square method. The unweighted version is pretty straightforward to implement. If x is a vector with p-values, then I guess that this will do for the unweighted version: statistic <- -2*sum(log(x)) comb.p <- 1-pchisq(statistic,2*length(x)) Has anyone written some R code for the weighted version? Regards, Anders Cederf...
2008 Apr 30
0
weighted nonlinear fits: `nls' and `eval'
...weighted fits. (I use version 2.6.2., but according to NEWS there were no changes to `nls' in 2.7.0, so the problem is still present). in this scenario their exists a serious problem. consider the following simple example, where some fixed model plus data are used to perform both unweighted and weighted fits. (I intentionally used very uneven weights to guarantee large differences in the results.) #================================CUT=========================== ln <- 100 x <- 1:ln y0 <- exp(-.02*x) y <- rnorm(y0, y0, .01) wts <- rep(1, ln...
2007 Mar 22
3
Cohen's Kappa
...###################### true-negativ:7445 false-positive:3410 false-negativ:347 true-positiv:772 classification-aggrement:68,6% kappa=agreement-chance/(1-chance) = (0.686-0.5)/0.5=0.372 .....with function from library(vcd) Kappa(matrix(c(7445,3410,347,772),nrow=2)) value ASE Unweighted 0.1686882 0.011235188 Weighted 0.1686882 0.007979293
2012 Mar 25
1
Accessing more than two coefficients in a plot
...ly using the first two of 4 regression coefficients" Is there another function like abline that will produce a line using the constant and three coefficients from the lm2.l regression? lm.l <- lm(Lambda1_2 ~ VV1_2, method = "qr", model = TRUE, x = FALSE, y = FALSE, qr = TRUE) # unweighted regression lm2.l <- lm(Lambda1_2 ~ VV1_2 + VV1_22 + VV1_212, method = "qr", model = TRUE, x = FALSE, y = FALSE, qr = TRUE) # unweighted regression plot(VV1_2, Lambda1_2, ylim=yrange, tck=1, main="V(1) Parameters (V, V^2 & V^0.5)", xlab="VV1_2", ylab="La...
2000 Sep 17
1
Weighted Histogram
...e way to calculate a weighted histogram where there may be zero raw counts in a given interval. Given equal-length vectors of data 'data' and weights 'w', and breaks (intervals) for the histogram, I calculate a weighted histogram as follows (see MASS's 'truehist' for an unweighted histogram): bin <- cut(data, breaks, include.lowest = TRUE) wsums <- sapply(split( w, f = bin), sum) prob <- wsums/(diff(breaks) * sum(w)) where 'bin' is the recoded data vector, 'wsums' is the sum of weights across each factor in 'bin', and 'prob'...
2009 Aug 03
1
Comparison of Output from "dwtest" and "durbin.watson"
Should "dwtest" and "durbin.watson" be giving me the same DW statistic and p-value for these two fits? library(lmtest) library(car) X <- c(4.8509E-1,8.2667E-2,6.4010E-2,5.1188E-2,3.4492E-2,2.1660E-2, 3.2242E-3,1.8285E-3) Y <- c(2720,1150,1010,790,482,358,78,35) W <- 1/Y^2 fit <- lm(Y ~ X - 1) dwtest(fit,alternative="two.sided")
2011 Oct 21
1
lattice::xyplot/ggplot2: plotting weighted data frames with lmline and smooth
...ot;, panel = function(x, y, ...) { panel.xyplot(x, y, ...) panel.lmline(x, y, col="blue", ...) panel.smooth(x, y, col="red", ...) } ) The following, using base graphics, illustrates the difference between the weighted and unweighted lines, for the total data frame: with(PearsonLee, { lim <- c(55,80) xv <- seq(55,80, .5) sunflowerplot(parent,child, number=frequency, xlim=lim, ylim=lim, seg.col="gray", size=.1) # unweighted abline(lm(child ~ parent), col="green", lwd=2)...
2006 Mar 01
2
Weighted networks and multigraphs
...integer weights, defined by a euclidean distance matrix. The package sna provides the measures that I want to use, but seems only to operate on binary graphs. I have read work by Mark Newman (http://aps.arxiv.org/abs/cond-mat/0407503/), who suggests that a weighted graph can be transformed into an unweighted multigraph, to which such measures can be applied. It seems that the package giRaph contains a function to handle multigraphs, but there is no example in the manual to show how it is used. I am also not sure whether this multigraph structure can be used as input into the relevant functions in t...
2012 Feb 06
1
Simple lm/regression question
I am trying to use lm for a simple linear fit with weights. The results I get from IDL (which I am more familiar with) seem correct and intuitive, but the "lm" function in R gives outputs that seem strange to me. Unweighted case: > x<-1:4 > y<-(1:4)^2 > summary(lm(y~x)) Call: lm(formula = y ~ x) Residuals: 1 2 3 4 1 -1 -1 1 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -5.0000 1.7321 -2.887 0.1020 x 5.0000 0.6325 7.906 0.0156...
2005 Jun 16
1
Survey - Cluster Sampling
...clus1 <- data.frame(cluster=c(1,1,1,2,2,2,3,3,3), id=seq(1:3,3), weight=rep(72/9,9), nl=rep(3,9), Nl=rep(3,9), N=rep(72,9), y=c(23,33,77, 25,35,74, 27,37,72) ) 1. Let M=m=3 and N=n=9. Then: dclus1<-svydesign(id=~cluster, data=clus1) svymean(~y, dclus1) mean SE y 44.778 0.294, the unweighted mean, assuming equal probability in the clusters. ok. 2. Let M=23, m=3 and N=72, n=9, then I am unable to use svydesign correctly: dclus2<-svydesign(id=~cluster, data=clus1, fpc=~N) svymean(~y, dclus2) mean SE y 44.778 0.2878, but it should be 23/72 * 1/3(133+134+136)=42.91, since...
2011 Aug 28
4
How do I get a weighted frequency table?
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110828/d35f51a1/attachment.pl>
2006 Aug 25
1
R.squared in Weighted Least Square using the Lm Function
...del<-lm(Y~X1+X2, weight=w) What I am confused is the r.squared. It does not seem that the r.squared for the weighted case is an ordinary 1-RSS/TSS. What is that precisely? Is the r.squared measure comparable to that obtained by the ordinary least square? <I also notice that model$res is the unweighted residual while summary(model)$res is the weighted residual> Thank you in advance for helping! Charles
2007 May 31
2
Factor analysis
Hi, is there any other routine for factor analysis in R then factanal? Basically I'am interested in another extraction method then the maximum likelihood method and looking for unweighted least squares. Thanks in advance Sigbert Klinke
2009 Jul 09
0
Apply weights to the Efron Approximation
...90998 age 0.036891147 0.03225069 -0.194126398 -0.004544225 -0.004544 0.03225 race 0.962911927 1.305255425 1.435340831 1.318038014 1.318038 1.30526 "replicated by weights" means that I also replicated individuals as many times as indicated by weights and applied unweighted Efron approximation to the replication of the dataset. The formula 4 can give me same results as the unweighted ones if I apply the same weights to each individual and also can give me the close results to the ones calculated by R (efron method+weights) if I apply different weights to each indi...
2009 Feb 06
0
Comparing weighted histograms?
...the two distributions on the same plot. E.g. one cross-hatched right and the other cross-hatched left. Do I need to pretend this is a survey and the "percentages' are survey weights? How is such a svydesign formed? Thanks in advance. PS I can plot a single unweighted histogram as follows: > > SurveyData <- read.table("C:/Data/R/RADAMdata2.csv", header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE) > MyX <- c(0,5,10,15,20,30,40,50,60,120) > hist(SurveyData$Miles2LAX, breaks = MyX, +...