search for: coeff

Displaying 20 results from an estimated 299 matches for "coeff".

Did you mean: coef
2010 Jan 02
1
Help with tryCatch
...to experiment with code, but I can't understand how to accomplish my desired task. Perhaps I need to use withCallingHandlers(), but the explanation of these functions is beyond my ken. My latest code follows. Any suggestions for corrections would be appreciated. # Define matrix to hold results coeffs <- matrix(nrow=10, ncol=3) dimnames(coeffs) < -list(NULL,c("BMI","BMIsq","min")) # set row counter n<-0 # Function to run testone<-function() { SampleData<-sample(1:SS,size=SS,replace=TRUE) result<-summary(glm(AAMTCARE~BMIEpiRevAdjc+BMIEpiRevAdjcSq...
2010 Nov 09
0
convergence message & SE calculation when using optim( )
Hi R-users, I am trying to estimate function parameters using optim(). My count observations follows a Poisson like distribution. The problem is that I wanna express the lambda coefficient, in the passion likelihood function, as a linear function of other covariates (and thus of other coefficients). The codes that I am using (except data frame) are the following (FYI the parameters need to be positive): myfun <- function(coeff, H1, H2, p, Range) { (coeff[1]+coeff[2]*...
2008 Aug 11
3
Peoblem with nls and try
...singolarmente P1<-data.frame(Time=a[,2],RFU=a[,i+2]) P1<-data.frame(Time=a[,1],RFU=a[,2]) nlmod2 <- nls(RFU ~ A + (B+c*Time)/(1+exp(k*(e-Time))), P1, start = list(A = 100, c = 1, B = 10, k =2, e = 10),control = nls.control(maxiter = 100000),trace = TRUE) print (summary(nlmod2)) coeff<-coefficients(nlmod2) c<-coeff["c"] A<-coeff["A"] B<-coeff["B"] e<-coeff["e"] k<-coeff["k"] summary(nlmod2) plot(P1) lines(P1[,1],nlmod2,lwd=2,col=2) lag1 <- e-(2/k) print(lag1) abline(v=lag1,col=4) print("nlmod2")...
2008 Aug 18
1
"nested" getInitial calls; variable scoping problems
...he minimum necessary to demonstrate my problem (I think); the real situation is more complicated. Two similar selfStart functions, ssA and ssB. The 'initial' function for ssB modifies its arguments a little and then calls getInital for ssA. In addition to the "x" and the fitted coefficients ("Coeff"), ssA and ssB have arguments ("A") which are not the same length as the dataframe, so cannot be passed as columns of that dataframe. The initial function for ssA uses eval(... parent.frame()) to find "A", which is fine when called from .GlobalEnv. B...
2010 Oct 17
4
Variable name as string
Hello, from Verzani, simpleR (pdf), p. 80, I created the following function to test the coefficient of lm() against an arbitrary value. coeff.test <- function(lm.result, var, coeffname, value) { # null hypothesis: coeff = value # alternative hypothesis: coeff != value es <- resid(lm.result) coeff <- (coefficients(lm.result))[[coeffname]] # degrees of freedom = length(var...
2010 Nov 16
2
Integrating functions / vector arithmetic
...ntegrate over an interval using the function 'integrate' from the 'stats' package. As an example, please consider the function h(u)=sin(pi*u) + sqrt(2)*sin(pi*2*u) + sqrt(3)*sin(pi*3*u) + 2*sin(pi*4*u) Two alternative ways to 'build' this function are as in f and g below: coeff<-sqrt(1:4) zeta<-function(i) {force(i); function(u){ zeta<-sqrt(2)+sin(pi*i*u) }} f<-function(u){ f<-0 for (j in 1:4){ f<-f+coeff[j]*(zeta(j)(u)) } f<-f } g<-function(u){ g<-crossprod(coeff,zeta(1:4)(u)) } Obviously, f and g are equivalent, but in the...
2010 Sep 24
3
Odds ratio from Logistic model in R
......,family=binomial....). I've written my own, but >certainly someone did a better job. I show a simple function to do this in my introductory notes available from: http://www.myatt.demon.co.uk basically it is: lreg.or <- function(model) { lreg.coeffs <- coef(summary(salex.lreg)) lci <- exp(lreg.coeffs[ ,1] - 1.96 * lreg.coeffs[ ,2]) or <- exp(lreg.coeffs[ ,1]) uci <- exp(lreg.coeffs[ ,1] + 1.96 * lreg.coeffs[ ,2]) lreg.or <- cbind(lci, or, uci) lreg.or }...
2011 Feb 08
4
Interactions in a nls model
...start=c(a=1,b=1,c=1)) nls.ci.gr.soybean <- nls(lai~eq(ci.gr,a,b,c),data=subset(data,crop=="soybean"), start=c(a=1,b=1,c=1)) #test interactions according to Introductory Statistics with R by Dalgaard p. 213# corn.soybean.interactions.ci.re.a <- abs((summary(nls.ci.re.corn)$coeff[1,1]- summary(nls.ci.re.soybean)$coeff[1,1])/ sqrt(summary(nls.ci.re.corn)$coeff[1,2]^2+ summary(nls.ci.re.soybean)$coeff[1,2]^2)) corn.soybean.interactions.ci.gr.a <- abs((summary(nls.ci.gr.corn)$coeff[1,1]- summary(nls.ci.gr.soybean)$coeff[1,1])/ sqrt(summary(nls...
2007 Dec 02
3
Help with a Loop
...172 0 3 10 1.55323 216 0 3 9 1.24088 65 0 4 8 2.49412 69 0 4 5 1.79840 This is my thought process of what the loop needs to do but I cant get the correct loop. X1=Day[Participant=="1"] Y1=DrugLevel[Participant=="1"] Coeffs=function(X1,Y1) { lmfirst=lm(Y1~X1) lmfirst$coefficients } Coeffs(X1,Y1) # output slope and intercept here # do same for the next participant X2=Day[Participant=="2"] Y2=DrugLevel[Participant=="2"] Coeffs=function(X2,Y2) { lmfirst=lm(Y2~X2) lmfirst$coefficients } Coeffs(X2...
2008 Oct 15
1
Parameter estimates from an ANCOVA
...p("A", 11), rep("B", 11))) y=(c(cont[1:11]*4 , cont[1:11]*2))+rnorm(mean=0, sd=.05, 22) fit=lm(y~categ*cont) scatterplot(y~cont|categ) # shows interaction scatterplot(y~categ|cont) # shows effect of the categorical variable, irrespective of cont summary(fit); anova(fit) coeff=coef(summary(fit))[,1] # column of estimates to "coeff" grandmean=coeff[1]+ mean(cont)*coeff[3] #GM = intercept + mean(cont)*regression_slope = 45.00677 slope_A=coeff[3]+coeff[4] #slope of individual regression for A = 3.998 slope_B=coeff[3]+(-coeff[4]) #slope of individual regressi...
2010 Nov 03
2
memory allocation problem
...0.1052789 4 1 0.1 0 0 1 100 4 2.8766364 0.1022138 5 1 0.1 0 0 1 100 0 0.3496872 0.1041056 6 1 0.1 0 0 1 100 0 0.1050840 0.3572036 > >est_coeff <- optim(coeff,SS, steps=org_results$no.steps, Range=org_results$Range, H1=org_results$H1, H2=org_results$H2, p=org_results$p) Error: cannot allocate vector of size 5.0 Mb In addition: Warning messages: 1: In optim(coeff, SS, steps = org_results$no.steps, Range = org_results$Range, : Reac...
2006 Oct 04
1
strip function
...;,"16","21","21.5","5","17","14","7","8","30"),strip.names=c(1,0),strip.levels=c(0,0)),panel=function(x,y) { panel.xyplot(x,y,pch=4,col=3) type = c("p", "r") COEFF<-coef(lm(log(y)~x)) panel.curve(exp(COEFF[1]+COEFF[2]*x),col=4) a<-round(COEFF[1],digit=2) b<-round(COEFF[2],digit=2) formula<-as.name(paste("y=exp(",a,b,"x)",sep="")) panel.text(10,700,formula) }) I cannot...
2008 Sep 19
0
panel data analysis possible with mle2 (bbmle)?
Dear R community, I want to estimate coefficients in a (non-linear) system of equations using 'mle2' from the "bbmle" package. Right now the whole data is read in as just one long time series, when it's actually 9 cross sections with 30 observations each. I would like to be able to test and correct for autocorrelation...
2006 Aug 21
4
question about 'coef' method and fitted_value calculation
Dear all, I am trying to calculate the fitted values using a ridge model (lm.ridge(), MASS library). Since the predict() does not work for lm.ridge object, I want to get the fitted_value from the coefficients information. The following are the codes I use: fit = lm.ridge(myY~myX,lambda=lamb,scales=F,coef=T) coeff = fit$coef However, it seems that "coeff" (or "fit$coef") is not really the coefficients matrix. From the manual, "Note that these are not on the original sc...
2004 Oct 22
3
Convert a list in a dataframe
Hi, I've a list containing parameters (intercepts & coefficients) of 12 regressions fitted > coeff [[1]] (Intercept) anno -427017.1740 217.0588 [[2]] (Intercept) anno -39625.82146 21.78025 ..... [[12]] (Intercept) anno 257605.0343 -129.7646 I want create a data frame with two columns (intercept and anno)usi...
2001 Aug 31
2
contrasts in lm
I've been playing around with contrasts in lm by specifying the contrasts argument. So, I want to specify a specific contrast to be tested Say: > y _ rnorm(100) > x _ cut(rnorm(100, mean=y, sd=0.25),c(-3,-1.5,0,1.5,3)) > reg _ lm(y ~ x, contrasts=list(x=c(1,0,0,-1))) > coef(reg)[2] x1 -1.814101 I was surprised to see that I get a different estimate for the
2018 Jul 10
9
[PATCH 0/7] PowerPC64 performance improvements
The following series adds initial vector support for PowerPC64. On POWER9, flac --best is about 3.3x faster. Amitay Isaacs (2): Add m4 macro to check for C __attribute__ features Check if compiler supports target attribute on ppc64 Anton Blanchard (5): configure.ac: Remove SPE detection code configure.ac: Add VSX enable/disable configure.ac: Fix FLAC__CPU_PPC on little endian, and add
2010 May 24
1
retrieve path analysis coefficients (package agricolae)
Dear list, I'd like to use path.analysis in the package agricolae in batch format on many files, retrieving the path coefficients for each run and appending them to a table. I don't see any posts in the help files about this package or the path.analysis package. I've tried creating an object out of the call to path.analysis, but no matter what I try, the function automatically prints the result. I'll be gra...
2011 Mar 01
1
theora encoder reordering, order of puting data from DCT 8x8 blocks to huffman compressor, and puting result of huffman compressor to buffer bitstream memory
Good day! I'm creating HDL IP CORE (for using in FPGA) for theora encoder (now only I-frames). I don't undestand one moment. Now i develop such stages: 1. From RBG(byer) to YCbCr converter 2. DCT processing (8x8 pixels blocks) 3. Quantizator of DCT coeff. 4. Zig-Zag of quantized DCT coeff. and now i have uresolved last stage of compression - how i must send 8x8 blocks to huffman compressor? I don't understand ordering. I must send all DC coeff (Y, than Cb,Cr), after all AC-0 (Y, than Cb,Cr) .... after all AC-63 (Y, than Cb,Cr)? And put huffman...
2007 Feb 19
3
summary polr
Hi all, I have a problem to estimate Std. Error and t-value by ?polr? in library Mass. They result from the summary of a polr object. I can obtain them working in the R environment with the following statements: temp <- polr(formula = formula1, data = data1) coeff <- summary(temp), but when the above statements are enclosed in a function, summary reports the following error: Error in eval(expr, envir, enclos) : object "dat" not found Someone knows how I can solve the problem? Thanks for any help. Paolo