I would like to run the NLSstAsymptotic function for each of my columns (X1:X3 in the example data sheet, my real data sheet has many more columns and rows).
ID<-c(1,2,3,4,5,6,7,8,9,10,11,12,13)
X1<-c(0,1,2,4,5,5,6,7,8,9,10,10,11)
X2<-c(0,1,2,3,4,5,6,7,8,8,9,10,10)
X3<-c(0,1,2,3,4,4,5,6,7,8,9,10,11)
df<-data.frame(ID,X1,X2,X3)
df_new <- sortedXyData(expression(ID), expression(X1), data=df)
NLSstAsymptotic(df_new)
The desired result should take the following form:
b1
-1.31
-1.41
-0.84
How could I go about to do that?
Consider building a matrix of values from
NLSstAsymptotic
withsapply
across the x column names: