Please or to access all these features

Chat

Join the discussion and chat with other Mumsnetters about everyday life, relationships and parenting.

I realise there are better forums to ask, but does anyone have experience of multilevel imputation using mice in R

115 replies

StealthPolarBear · 12/04/2020 18:58

And be willing to answer some idiotic questions?

OP posts:
Fedupandpoor · 13/04/2020 09:39

I thought this was going to be some sort of mad scientist thread about testing on mice in a laboratory. Disappointed.

DrDreReturns · 13/04/2020 09:41

I used to find debugging R a right pain in the ass. My job was to convert stuff in R into a language we could integrate with our products (C#) but stepping through R was very fiddly IIRC.
Happy days, that was a great job Smile

Q1w2e3 · 13/04/2020 09:46

I thought this was going to be about lab experiments on mice. I am relieved it’s not. At least I think it’s not.

Magpiecomplex · 13/04/2020 10:01

No worries, Stealth! It's always easier to proof read someone else's code than your own... I'm a biologist rather than a statistician and you're doing a lot better as a beginner in R than I did.

DrDreReturns · 13/04/2020 12:10

This reminds me of pirate jokes we used to tell about R... What's a pirates favourite computer language? Aarrgh!

StealthPolarBear · 13/04/2020 16:52

It works! Clustering and all. Thank you for all the help and humour on the way.

OP posts:
TooMinty · 13/04/2020 18:57

Well done 👍
Coding is frustrating when you are stuck but very satisfying when you crack it!

nevergooogle · 13/04/2020 21:28

Also proving Mumsnet probably is the best forum for pretty much most things.

NorrieTheMouse · 13/04/2020 21:34

Hi @StealthPolarBear, am I right to think from previous posts you’re in the NE? If this is research at the uni then send me a PM as I might be able to point you in the direction of help there, for future reference if not for this issue.

lljkk · 13/04/2020 21:58

hey gals, can I ask a super stupid R question?

If I have a script that only has something like Print "hello world" and I am at the R prompt that looks like a Chevron (running R on unix)

How do I run that script so that it prints

hello world

I imagine the syntax would look like

[command to run scripts] nameofscript.txt
hello world

But I'll be damned if I know what [command to run scripts] is.

I can use Rscript from the unix shell prompt to run the script, I just think there MuST be a way to just run a script from the live > prompt. I know this is so simple that no one ever explains how to do it online. I am so embarrassed that I can read R code but I can't do the most basic thing like run a macro from the >.

I have too many problems trying to make Rstudio work, so please don't suggest Rstudio.

TIA, if you can help. stata is so much nicer ime but someone sent some R code to do clever things

StealthPolarBear · 13/04/2020 22:17

Lljkk I'm afraid I don't know. But that's the problem I seem to have, my queries are too easy to Google!

OP posts:
StealthPolarBear · 13/04/2020 22:18

Norrie I am on the NE but this is not university related. Appreciate the offer though

OP posts:
StealthPolarBear · 13/04/2020 22:20

Wouldn't you just navigate to the R directory and then just type in the name of the script file

Eg (oncw you're in the right directory)

helloworld.R

OP posts:
lljkk · 13/04/2020 23:10

i think i tried that...

midgebabe · 13/04/2020 23:13

Google run script

Something Like On command line

R scriptname

JoshLymanIsHotterThanSam · 13/04/2020 23:25

I read this whole thread despite not understanding a single word of it. Grin

nevergooogle · 13/04/2020 23:27

JoshLyman...
Grin
It's oddly compelling

midgebabe · 13/04/2020 23:38

Or even Rscript scriptname

It's late

Stillfunny · 13/04/2020 23:42

I am in awe ! I am way too old !Grin

StealthPolarBear · 14/04/2020 06:34

I thought you might have done. Worth checking!

OP posts:
StealthPolarBear · 14/04/2020 07:34

My script is taking too long. Is a reduction in the predicotss for each predicted variable likely to help much?

OP posts:
Binterested · 14/04/2020 07:43

It’s a bit like the shipping forecast Grin

midgebabe · 14/04/2020 08:09

Some stuff can take days on big datasets ( not used MICE )

If you are just checking the functionality of the script, would a smaller dataset help initially and then leave it for a week? How does it / underlying algorithm scale?

Magpiecomplex · 14/04/2020 08:24

@lljkk the command you want is source("myscript.R")
I can't take credit for knowing that - I looked it up in my copy of the R Cookbook! I use Rgui which might be more amenable than Studio.

Magpiecomplex · 14/04/2020 08:26

@StealthPolarBear how long is too long? I have one script I always leave running over lunch...

Swipe left for the next trending thread