search for: soybean

Displaying 20 results from an estimated 34 matches for "soybean".

2011 Feb 08
4
Interactions in a nls model
I am interested in testing two similar nls models to determine if the lines are statistically different when fitted with two different data sets; one corn, another soybean. I know I can do this in linear models by testing for interactions. See Introductory Statistics with R by Dallgaard p212-218 for an example. I have two different data sets I am comparing to lai. ci.re should have very little difference between corn and soybean, while ci.gr, there should be a di...
1999 Nov 25
1
gnls
...h gnls is also extremely slow: that one model takes longer than the time fitting all of the others together in the file below. I shall continue exploring nlme... Jim --------------------------------------------------------------------------- library(nlme) library(growth) #example from gnls data(Soybean) # variance increases with a power of the absolute fitted values summary(fm1 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal), Soybean, weights = varPower())) # errors follow an auto-regressive process of order 1 summary(fm2 <- gnls(weight ~ SSlogis(Time, Asym, xmid, scal), Soybea...
2003 Apr 02
4
randomForests predict problem
...utation is fine but each time I try to predict values with the newly created object, I get an error message. I thought I was because NA values in the dataframe, but I cleaned them and still got the same error. What am I doing wrong ? > library(mlbench) > library(randomForest) > data(Soybean) > test <- sample(1:683, 150, replace=F) > sb.rf <- randomForest(Class~., data=Soybean[-test,]) > sb.rf.pred <- predict(sb.rf, Soybean[test,]) Error in matrix(t1$countts, nr = nclass, nc = ntest) : No data to replace in matrix(...) I did it the same way with rpart and...
2010 May 11
1
merge two data frames
...ul/10", "COPPER May/10", "CORN Jul/10", "CORN May/10", "COTTON NO.2 Jul/10", "CRUDE OIL miNY May/10", "GOLD Jun/10", "HENRY HUB NATURAL GAS May/10", "ROBUSTA COFFEE (10) Jul/10", "SILVER May/10", "SOYBEANS Jul/10", "SPCL HIGH GRADE ZINC USD", "STANDARD LEAD USD", "SUGAR NO.11 Jul/10", "SUGAR NO.11 May/10", "WHEAT Jul/10", "WHEAT May/10"), class = "factor"), pl = c(4.75000000000003, -14, -1.5, 7.75, 3.74999999999999,...
2001 Jan 17
1
Pinheiro/Bates Soybean nlme failure
Dear Mixed Effect Friends, Somehow, R(1021, Windows) seem to run differently from S Plus: The soybean example from Pinheiro/Bates on page 290 fails in R. (Soybean1 is Soybean with the NA and "critical" case removed. Same procedure with full Soybean). > fm1Soy.lis<-nlsList(weight~SSlogis(Time,Asym,xmid,scal),data=Soybean1) > fm1Soy.nlme<-nlme(fm1Soy.lis) Error: Singularity in...
2003 Apr 03
0
debugging question
...reciated! Regards, Andy Andy I. Liaw, PhD Biometrics Research Phone: (732) 594-0820 Merck & Co., Inc. Fax: (732) 594-1565 P.O. Box 2000, RY84-16 Rahway, NJ 07065 mailto:andy_liaw@merck.com ========================== library(randomForest) library(mlbench) data(Soybean) Soybean <- Soybean[complete.cases(Soybean),] ## Drop empty levels: Soybean <- lapply(Soybean, function(x) factor(as.character(x))) nreps <- 100 rf.err <- numeric(nreps) for (i in 1:nreps) { test <- sample(nrow(Soybean), 150, replace=FALSE) sb.rf <- randomForest(Class~., dat...
2010 Apr 23
2
read.csv data frame thousands separator
Dear group, Here is my df, trades1 : trades1 <- structure(list(Instrument.Long.Name = c("CORN", "CORN", "CORN", "CORN", "CORN", "SOYBEANS", "SOYBEANS", "SOYBEANS", "SOYBEANS", "SOYBEANS", "SOYBEANS", "STANDARD LEAD USD", "STANDARD LEAD USD", "SPCL HIGH GRADE ZINC USD", "SPCL HIGH GRADE ZINC USD", "SPCL HIGH GRADE ZINC USD",...
2004 Feb 20
1
nlme and multiple comparisons
This is only partly a question about R, as I am not quite sure about the underlying statistical theory either. I have fitted a non-linear mixed-effects model with nlme. In the fixed part of the model I have a factor with three levels as explanatory variable. I would like to use Tukey HSD or a similar test to test for differences between these three levels. I have two grouping factors:
2010 Oct 20
0
bootstrapping nonlinear mixed effects models
In order to bootstrap nonlinear regression, the following code works. library(nlme) data(Soybean) fm1.nls <- nls(weight ~ SSlogis(Time, a, b, c), data=Soybean) summary(fm1.nls) bstat <- function(A, indices) { mboot <- nls(weight ~ SSlogis(Time, a, b, c), data=Soybean[indices, ]) return(coef(mboot)) } require(boot) boot1 <- boot(Soybean, bstat, 2000) boot1 For nonlinear mixed e...
2010 May 11
1
merging data frame
...merge. Here they are: pose16 <- structure(list(DESCRIPTION = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 12L), .Label = c("COPPER May/10", "COTTON NO.2 Jul/10", "CRUDE OIL miNY May/10", "GOLD Jun/10", "ROBUSTA COFFEE (10) Jul/10", "SOYBEANS Jul/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11 May/10", "WHEAT Jul/10", "PRIMARY NICKEL USD", "PRM HGH GD ALUMINIUM USD", "SPCL HIGH GRADE ZINC USD", "STANDARD LEAD USD"), class = "factor"), POSITION = c(2, -3...
2010 Apr 28
1
gsub,regex and replacing
...gsub and the regex functionalities to do this. Here is the data frame (df): DESCRIPTION prix quantity 1 CORN Jul/10 -1.5 0 2 CORN May/10 -1082.0 -3 3 ROBUSTA COFFEE (10) Jul/10 11084.0 8 4 SOYBEANS Jul/10 1983.5 2 5 SPCL HIGH GRADE ZINC USD Jul/10 -2464.0 -1 6 STANDARD LEAD USD Aug/10 -118.0 0 For each df$DESCRIPTION element containing "USD" I want to remove the last part of it(i.e Jul/10, or Aug/10...). I was thinking of something like that: >Df$...
2002 May 08
3
R 1.5.0 terminated while plotting groupedData
Dear R-help; Following the installation of R 1.5.0 and library packages to my Win 2K machine, I tested the new R system: > library(nlme) Loading required package: nls > library(lattice) Loading required package: grid >data(Soybean) >plot(Soybean) A program error appears: "Rgui.exe has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created". Both nlme and lattice libraries are current. Apparently, there are bugs somewhere. Richard -.-.-.-.-.-.-.-...
2004 Oct 01
4
gnls or nlme : how to obtain confidence intervals of fitted values
Hi I use gnls to fit non linear models of the form y = alpha * x**beta (alpha and beta being linear functions of a 2nd regressor z i.e. alpha=a1+a2*z and beta=b1+b2*z) with variance function varPower(fitted(.)) which sounds correct for the data set I use. My purpose is to use the fitted models for predictions with other sets of regressors x, z than those used in fitting. I therefore need to
2010 Aug 04
3
merge two data frames
...data frames: av <- structure(list(DESCRIPTION = c("COFFEE C Sep/10", "COPPER Sep/10", "CORN Dec/10", "CRUDE OIL miNY Sep/10", "GOLD Aug/10", "HENRY HUB NATURAL GAS Sep/10", "PALLADIUM Sep/10", "SILVER Sep/10", "SOYBEANS Nov/10", "SPCL HIGH GRADE ZINC USD", "SUGAR NO.11 Oct/10", "WHEAT Sep/10"), prix = c(-168.3, -1.60000000000002, -773.75, -78.75, -1168.3, -0.0919999999999996, -470.75, 1758.5, -975.25, 1964, -19.09, -605.75), pos = c(-1, 0, -2, -1, -1, 0, -1, 1, -1, 1, -1, -1), P...
2000 Feb 11
1
R CMD check [nlme|MASS] fails (PR#431)
Mmmh, seems as if I really should change my options as I seem to keep sending off empty bug-reports ;-/ Sorry guys. Here is the content that should have been in the last e-mail: `R CMD check nlme' fails on my machine. The final output in nlme-Ex.Rout is: > library(nlme) > data(Soybean) > fm1 <- nlme(weight ~ SSlogis(Time, Asym, xmid, scal), data = Soybean, + fixed = Asym + xmid + scal ~ 1, start = c(18, 52, 7.5), + control = list(nlmStepMax = 1.0)) Error in nlme.formula(weight ~ SSlogis(Time, Asym, xmid, scal), data = Soybean, : Maximum number of...
2001 May 31
1
nlme and memory
I am trying to follow an example in Pineiro & Bates's book library(nlme) data(Soybean) soy.lis<-nlsList(weight~SSlogis(Time,Asym,xmid,scal),data=Soybean) soy.nlme<-nlme(soy.lis) Error: Calloc could not allocate (151974496 of 8) memory This is not a large problem-- only 412 observations. I am using R-1.2.3 with automatic memory allocation. Does this message mean that I need to...
2009 May 04
1
how to change nlme() contrast parametrization?
How to set the nlme() function to return the answer without the intercept parametrization? #========================================================================================= library(nlme) Soybean[1:3, ] (fm1Soy.lis <- nlsList(weight ~ SSlogis(Time, Asym, xmid, scal),                        data = Soybean)) (fm1Soy.nlme <- nlme(fm1Soy.lis)) fm2Soy.nlme <- update(fm1Soy.nlme, weights = varPower()) plot(ranef(fm2Soy.nlme, augFrame = TRUE),      form = ~ Year * Variety, layout = c(3...
2005 Mar 02
1
Using varPower in gnls, an answer of sorts.
...Windows XP and 2.0.1-Patched 2005-01-26 on Linux. The key feature of that example is that the data are being passed in the environment. Consider a modification of the example in the man page for gnls: First, something that should work: > gnls(weight ~ Asym/(1 + exp((xmid - Time)/scal)),data=Soybean, + start=c(Asym=16,xmid=50,scal=7),weights=varPower()) Generalized nonlinear least squares fit Model: weight ~ Asym/(1 + exp((xmid - Time)/scal)) Data: Soybean Log-likelihood: -486.8973 Coefficients: Asym xmid scal 17.35681 51.87230 7.62052 Variance function: Structure: Power...
2010 Apr 28
3
data frame move columns
Dear group, Here is my df: avprix <- structure(list(DESCRIPTION = c("CORN Jul/10", "CORN May/10", "ROBUSTA COFFEE (10) Jul/10", "SOYBEANS Jul/10", "SPCL HIGH GRADE ZINC USD", "STANDARD LEAD USD"), prix = c(-1.5, -1082, 11084, 1983.5, -2464, -118), quantity = c(0, -3, 8, 2, -1, 0), fees = c(-8.64, -30.24, -26.4, -25.92, -37.5, -25)), .Names = c("DESCRIPTION", "prix", "quantity&quo...
2009 May 01
2
combine column names
Dear R-list, Is there any way I can extract part or whole column name from two variables and combine them? Not values, but column names. For example, I have data set with 70 variables. The column names are "Alfalfa", "Corn","Soybean",..."Sunflower". After I combine the two variable (say Alfalfa and Corn), I want to rename it as "AlfCor" or "AlfalfaCorn" automatically not manually. In excel, I found the function combining two texts in individual columns using (=A1&B1, if you want to comb...