Linear Spline Modelling error

Welcome to the forum for R2MLwiN users. Feel free to post your question about R2MLwiN here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to R2MLwiN: Running MLwiN from within R >> http://www.bris.ac.uk/cmm/software/r2mlwin/
Post Reply
scottwaterfield
Posts: 2
Joined: Tue Dec 01, 2020 4:35 pm

Linear Spline Modelling error

Post by scottwaterfield »

Hi,
I am trying to run a linear spline model with 3 knot points.
I have code as follows:
(Mod <- runMLwiN(DX ~ 1 + s1 + s2 + s3 + s4 + (1 + s1 + s2 + s3 + s4|ID) + (1|occasion),
estoption = list(resi.store = TRUE),
data = df))

the data is sorted by: ID, followed by ocassion.
But I get the following when running the above code, which I can't find any guidance on:

/nogui option ignored
ECHO 0


Echoing is ON
BATC 1

Batch mode is ON
MAXI 2
STAR
iteration 0

Convergence not achieved
TOLE 2
MAXI 20
NEXT

error while obeying batch file C:/Users/gv20022/AppData/Local/Temp/Rtmpa2kQlY/macrofile_11dc17bf25db.txt at line number 83:
NEXT

random part gone to zero - can not continue


error while obeying batch file C:/Users/gv20022/AppData/Local/Temp/Rtmpa2kQlY/macrofile_11dc17bf25db.txt at line number 83:
NEXT


random part gone to zero - can not continue
.
Execution completed

Error in foreign::read.dta(IGLSfile) :
unable to open file: 'No such file or directory'

Thanks,
Scott
scottwaterfield
Posts: 2
Joined: Tue Dec 01, 2020 4:35 pm

Re: Linear Spline Modelling error

Post by scottwaterfield »

I have since found another question on this board asking a very similar question (viewtopic.php?f=7&t=3272&p=6622&hilit=s ... dc84#p6622), but have failed to successfullly enact the changes.

My code now looks as such:
smat <- matrix(nrow=2, ncol=2)
smat[1, 1] <- 1 # Level of covariance matrix
smat[1, 2] <- 2 # Level of covariance matrix
smat[2,] <- 1 # Set matrix type to diagonal
(Mod_TotFat_M <- runMLwiN(DX ~ 1 + s1 + s2 + s3 + s4 + (1 + s1 + s2 + s3 + s4|ID) + (1|occasion),
estoption = list(resi.store = TRUE, debugmode=T,
reset=c(0, 0), maxiter=150, smat=smat),
data = TotFat_M))

This now returns the following (near identical error):
/nogui option ignored
ECHO 0


Echoing is ON
BATC 1

Batch mode is ON
MAXI 2
STAR
iteration 0

Convergence not achieved
TOLE 2
MAXI 150
NEXT

error while obeying batch file C:/Users/gv20022/AppData/Local/Temp/RtmpEJGuA9/macrofile_19f852b87065.txt at line number 97:
NEXT

random part gone to zero - can not continue


error while obeying batch file C:/Users/gv20022/AppData/Local/Temp/RtmpEJGuA9/macrofile_19f852b87065.txt at line number 97:
NEXT


random part gone to zero - can not continue
.
Execution completed

Error in foreign::read.dta(IGLSfile) :
unable to open file: 'No such file or directory'
ChrisCharlton
Posts: 1244
Joined: Mon Oct 19, 2009 10:34 am

Re: Linear Spline Modelling error

Post by ChrisCharlton »

Have you checked what the model equation looks like in MLwiN (this should automatically open when you run the command with the degbugmode option turned on)?
Post Reply