|
Post by emmamelanson on Jul 20, 2020 15:20:48 GMT
Hello,
Is anyone familiar with the specifics of the syntax for xyplot and lineplot? I can't find anything more specific than this :
lineplot [c?] ( ; color c? )
xyplot [c?][c?] (; select c? == value )
I'm using xyplot and I understand that I need to specify first my X column and then my Y column, and that I can select only trials for which the status is correct, but is there a way to manipulate axis options? Or to plot a variable that isn't saved in a column but rather previously calculated in the feedback section (using mean for example)? Ideally I would want the plot to display only the mean RT, so one data point for each of my 8 set sizes, instead of all the data points.
I'm also wondering if you can set min and max values for the axis, or change the number of tick marks? I'm plotting RT on the Y axis but it's displaying so many tick marks on the Y axis it's difficult to read.
Any knowledge on these commands would be appreciated! Thanks so much!
Emma
|
|
|
Post by alexandra (AEC) on Jul 20, 2020 16:26:38 GMT
Hi there, I assume the functions you name are those usable in R? If you are using the interface RStudio, you would have a "help"-window on the right, in which you could type the function name to get more information on any function you are interested in. Most R functions are well documented and can be found searching R and the function name. I did this, for example, for the xyplot() function and found the following: www.rdocumentation.org/packages/lattice/versions/0.10-10/topics/xyplotThe help() function is another useful tool when using R and wanting to know more about a certain function. Here is more detailed information on how to use it: www.r-project.org/help.htmlIn general, it is very convenient, if you save all necessary data for a graph in a data frame [ data.frame() would be the function to do so] or a another type of variable, which you then can read the data from. In your case you probably would want to calculate the mean RT for each condition and participant and save it all in a data frame with the participant, condition and mean RT in a column each. If you are only interested in the mean RT per condition across the whole sample, you would just calculate that instead, i.e.: meansConditions <- aggregate(RT ~ condition, data = alldata, mean)I have made up names for the variables, which contain all your data. Consequently, you would have to change those accordingly. The function aggregate() can be used for all kind of functions. It provides the possibility to define a formula (in your case your interest of RT for each condition, meaning dependent variable to independent variable), the data place (here I called the variable alldata) and the function you want to apply (here you are interested in the mean, so the mean() function is used justed without the parentheses). You can define the length of the x and y axes by using xlim and ylim respectively. I hope this helps you getting further with your analysis plans.
|
|
|
Post by emmamelanson on Jul 20, 2020 20:12:06 GMT
Thank you for your reply! Actually, I was talking about functions in Psytoolkit itself. It seems that in the Psytoolkit documentation xyplot and lineplot are part of the feedback section, there just isn't much information on how to use them. www.psytoolkit.org/doc3.1.0/feedback.html#_lineplot_and_xyplotI have used R before, but I will eventually download this experiment and send it to students in the HTML format so they can all do the experiment on their own and get ideally have the results immediately graphed without needing to call R. It is my understanding that this can be achieved with Psytoolkit just on its own, but I might be mistaken.
|
|
|
Post by alexandra (AEC) on Jul 21, 2020 8:57:14 GMT
I fear that I have no experience with those functions in PsyToolkit. I know that it was possible to use an R script in the Linux version to create a nice graph as feedback but I have no idea on the implementation in the online version.
|
|
|
Post by PsyToolkit on Jul 22, 2020 9:00:29 GMT
There is an example of an experiment that uses it. It might help you to do what you want.
I will update the documentation soon as well, thanks for pointing this out.
|
|