Displaying 1 result from an estimated 1 matches for "wu_data".
Did you mean:
wb_data
2007 Sep 29
1
[Help] Error when using nls
...I am a student of Earthquake Engineering, and am new to R.
Currently I try to run nonlinear regression analysis by R. My data
has three variables: X, Y, and Z. Z is a function of (X, Y). My R
script is as below.
rm(list=ls())
# read in data
Alldata <- read.table("~/Documents/R/Wu_data.dat", header=TRUE)
# assign variables
Z <- Wu[[1]] # N1,60
X <- Wu[[2]] # CSR
Y <- Wu[[3]] # ev, %
# set the data frame
data1<- data.frame(cbind(N,CSR,ev))
# call nls funciton
out <- nls(Z~X/(1/(a+b*ev+c*(Y^2))+X/(d+e*exp(f*Y)))-g, data1,
selfStart, trace=T)
In to...