[R] Mailinglist

Richard M. Heiberger rmh @ending from temple@edu
Tue Jan 8 17:32:47 CET 2019


please post a sample dataset based on
mydata <- rbind[participant1[1:3,], participant2[1:4,], participant3[1:5,])

I think mydata at this point is anonymized enough that you can post
it.  Verify with whomever, though.
You might want to change those random U* names of the participants to
c("A","B","C")

post dput(mydata) to the list, in the body of the email.

I think this and the details you posted today will enable one of us to
give you a much simpler script, or maybe even function, to process
your full dataset.
Please confirm that participant1 and p1 are the same object.

Rich

That

On Tue, Jan 8, 2019 at 10:23 AM Rachel Thompson
<rachel.thompson using student.uva.nl> wrote:
>
> Hi
>
> Thank you for your help and suggestions!
> I have tried a few things and ask help from lots of people online!
>
> My problem is that I am not able to share the database! I tried to recreate one but I wasn't successful.
> So I found a way to analyze each subject individually, but I do not know how to perform the same steps for all of the subjects at once.
> But I just wanted to share what I did, since you tried to help me!
>
> This is what I did.
>
> I stored all the column names in a vector named "Names"
>
> names=c("participants","id","participantid","key","probetype","time","timespecific","value","valuespecified","valuedetailed","period","periodspecified")
>
>
>
> colnames(gmoji_passivedata)=names
>
>
>
> I used this code to find the number of participants in the dataset
>
>
>
> length(unique(gmoji_passivedata$participants))
>
> The number of participants is 44
>
>
>
> I used this code to find the unique ID for every participant
>
>
>
> library(plyr)
>
> > count(gmoji_passivedata,”participants")
>
> From the dataset, I selected one participant ""U_..."
>
> I used subset data
>
>
>
> participant1=subset(gmoji_passivedata,participants=="U_0139cf62_e615_41f7_a4cc_878c0490c510")
>
>
>
>
>
> With the table code
>
> table(p1$probetype) I found the counts of all the different values of the probe type column
>
>
>
> edu.mit.media.funf.probe.builtin.ActivityProbe
>
>                                                                       16167
>
> edu.mit.media.funf.probe.builtin.BluetoothProbe
>
>                                                                       405
>
>   edu.mit.media.funf.probe.builtin.CallLogProbe
>
>                                                                       1427
>
>    edu.mit.media.funf.probe.builtin.ScreenProbe
>
>                                                                       1791
>
>      edu.mit.media.funf.probe.builtin.WifiProbe
>
>                                                                        5386
>
>
>
> The count for the call log probe for the selected participant is 1427
>
>
>
> There was only one participant with sms probe for the rest of the participant the count of sms probe is 0
>
>
>
> For the screen probe and activity probe I found the total count (1791 and 16167)
>
>
>
> For screen probe, I used a subset code and set the value detailed column to false and true
>
>
>
> screenon_false=subset(p1,valuedetailed=="False") (this participant 875)
>
> screenon_true=subset(p1,valuedetailed=="True")   (this participant 916)
>
>
>
> and for activity probe to none, low and high to find the required values
>
>
>
> activity_none=subset(p1,valuedetailed=="none")   (this participant 12900)
>
> activity_low=subset(p1,valuedetailed=="low")     (this participant 1050)
>
> activity_high=subset(p1,valuedetailed=="high")   (this participant 2217)
>
>
>
>
>
> I did this for each participant
>
>
> Best,
>
>
> Rachel
>
>
> On Sun, Jan 6, 2019 at 2:48 PM Richard M. Heiberger <rmh using temple.edu> wrote:
>>
>> Questions like this
>> 1. I want to have a summary of how many times a specific subject got called
>> (CallLogProbe)
>>
>> suggest that you should look at the table function.  See
>> ?table
>> and run the examples.
>> They show how to get one-way frequency tables and two-way contingency tables.
>>
>> If you have followup questions for the list, you can use the examples in ?table as your starting point.
>> That way you don't need to worry about sharing your own data.
>>
>>
>> On Sun, Jan 6, 2019 at 1:59 PM Rachel Thompson <rachel.thompson using student.uva.nl> wrote:
>>>
>>> Hi Rich,
>>>
>>> I really feel lost at this point.
>>> I need a code that helps me count the phone activity level(high/low/none),
>>> the screen activity (on/off) and the amount calls and SMS of each subject.
>>>
>>> 1. I want to have a summary of how many times a specific subject got called
>>> (CallLogProbe)
>>> 2. I want to have a summary of how many times a specific subject got a text
>>> message (SMS probe)
>>> 3. I want to have a summary of how many times a specific subject
>>> - Turned their screen on - True  (ScreenProbe)
>>> - Or did not turn their screen on - False (ScreenProbe)
>>> 4.  I want to have a summary of the activity level of a specific subject
>>> - Activity level - none (ActivityProbe)
>>> - Activity level- low     (ActivityProbe)
>>> - Activity level - High  (ActivityProbe)
>>>
>>> I want to do this for all the 36 subjects(Participants).
>>> In the end, I have to define the percentages and cutoff points of what is
>>> considered low-medium-high, based on what the results of all the subjects
>>> are. So I am able to see if a specific subject has low social interaction
>>> etc.
>>>
>>> I have tried a lot, with the help of youtube etc. But I feel as if I am
>>> trying a lot of things but without clearly knowing if it is the right step.
>>> I have a csv file, but I need to look into what Jeff said about the guides.
>>> So I am able to share it.
>>>
>>> Best.
>>>
>>>
>>> On Sun, Jan 6, 2019 at 11:51 AM Rich Shepard <rshepard using appl-ecosys.com>
>>> wrote:
>>>
>>> > On Sun, 6 Jan 2019, Rachel Thompson wrote:
>>> >
>>> > > I am an intern from Amsterdam and I have to do an analysis in R. I spoke
>>> > > to my professor in Amsterdam and my supervisor's here in Boston. But they
>>> > > are to busy to help. I informed them from the start that I am not
>>> > familiar
>>> > > with R(Rstudio) and they told me that I would receive guidance. So since
>>> > > they can not help me, I decided to share my problem online. (It is a CVS
>>> > > file imported into R)
>>> >
>>> > Rachel,
>>> >
>>> >    I find it interesting that you're put in such a difficult position. I've
>>> > not followed this thread from the start so my comments might be redundant
>>> > or
>>> > inappropriate.
>>> >
>>> >    If you can, describe the problem. That is, what are you being asked to
>>> > find and what are the available data? This information helps us to guide
>>> > you
>>> > to learning the mechanics for accomplishing your task with R.
>>> >
>>> > Regards,
>>> >
>>> > Rich
>>> >
>>> > ______________________________________________
>>> > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> > https://stat.ethz.ch/mailman/listinfo/r-help
>>> > PLEASE do read the posting guide
>>> > http://www.R-project.org/posting-guide.html
>>> > and provide commented, minimal, self-contained, reproducible code.
>>> >
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list