I am not sure what you mean by "p is not updated". I took the basic
outline you have and as you can see, p has the correct value after the
loop.
> p<-0.1
> n<-10
> result<-list()
> while (p<=1) {
+ for (i in 1:n) {
+ result[[i]]<-p
+ p<-p+0.1
+ print(p)
+ }
+ }
[1]
Hi all,
I am running OLS models with a power parameter: y=a+bx^p, and I want to iterate
through p with a set increment. The function I constructed is something like
below:
test<-function(data, model,...){
f<-formula(model) #model="y~I(x^p)"
p<-0.1
n<-10
result<-list()
while (p<=1) {
for (i in 1
2 matches
Mail list logo