• Complain

Knoblauch Kenneth - Modeling Psychophysical Data in R

Here you can read online Knoblauch Kenneth - Modeling Psychophysical Data in R full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: New York, year: 2012, publisher: Springer, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Knoblauch Kenneth Modeling Psychophysical Data in R

Modeling Psychophysical Data in R: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Modeling Psychophysical Data in R" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Knoblauch Kenneth: author's other books


Who wrote Modeling Psychophysical Data in R? Find out the surname, the name of the author of the book and a list of all author's works by series.

Modeling Psychophysical Data in R — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Modeling Psychophysical Data in R" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Kenneth Knoblauch and Laurence T. Maloney Use R! Modeling Psychophysical Data in R 2012 10.1007/978-1-4614-4475-6_1 Springer Science+Business Media New York 2012
1. A First Tour Through R by Example
Kenneth Knoblauch 1 and Laurence T. Maloney 2
(1)
Department of Integrative Neurosciences, Stem-cell and Brain Research Institute INSERM U846, 18 avenue du Doyen Lpine, Bron, France
(2)
Department of Psychology Center for Neural Science, New York University, 6 Washington Place, 2nd Floor, New York, USA
Abstract
In this chapter we illustrate how R can be used to explore and analyze psychophysical data. We examine a data set from the classic article by Hecht et al. [79] in order to introduce basic data structures and functions that permit us to examine and model data in R .
1.1 Getting Started
In this chapter we illustrate how R can be used to explore and analyze psychophysical data. We examine a data set from the classic article by Hecht et al. [] in order to introduce basic data structures and functions that permit us to examine and model data in R .
The best way to read this book is sitting at a computer with R running, typing in the examples as they occur. If you do not already have R installed on your computer, see Appendix A for instructions on how to install it. If you have properly installed R and launched it by double clicking on an icon or by running the command R from a terminal command line, you should see some initial information printed out about the version followed by some initial suggestions of things to explore, demo() , help() , etc. This is followed by > on a line by itself. This is the command line prompt and indicates where you type in commands. If you enter a new line (carriage return) before the end of a command, the prompt will become a + , indicating a continuation of the previous line. You will continue to receive continuation lines until the command is syntactically complete, at which point R will attempt to interpret it. Comments in R are preceded by a # . Everything on the line to the right of a comment character is ignored by R . Lets proceed with the example.
1.2 The Experiment of Hecht, Shlaer and Pirenne
In a classic experiment, Hecht et al. [] estimated the minimum quantity of light that can be reliably detected by a human observer. In their experiment, the observer, placed in a dark room, was exposed at regular intervals to a dim flash of light of variable intensity. After each flash presentation, the observer reported seen or unseen. The data were summarized as the percentage of reports seen for each intensity level used in the experiment, for each observer.
Before collecting these data, Hecht et al. performed extensive preliminary analyses in order to select viewing conditions that are described in their article, for which human observers are most sensitive (requiring the fewest number of quanta to detect) and a detailed analysis of their choices is presented in the opening chapter of Cornsweets text [].
1.2.1 Accessing the Data Set
The data from their main experiment (Table V in [). If you are connected to the internet, then it can be installed from within R by executing the function
Modeling Psychophysical Data in R - image 1
Thereafter, to have access to the data sets, the package has to be loaded into memory and attached to the search path using the function:
Modeling Psychophysical Data in R - image 2
The search path is a series of environments (see Sect.A.2.5) in memory in which sets of functions and data objects are stored, for example, those from a package. When a function is called from the command line, R will look for it in the succeeding environments along the search path. The library function attaches the package to the second position on the search path, just behind the work space, called .GlobalEnv . We verify this using the search function
which in this case returns an 11-element vector of character strings The - photo 3
which, in this case, returns an 11-element vector of character strings. The specific packages you see will depend on your version of the language R and may not be the same as those shown above.
The data set is called HSP and can now be loaded into the work space by
Modeling Psychophysical Data in R - image 4
and we can check that it is there by typing
Modeling Psychophysical Data in R - image 5
which returns a vector of the names of the objects in your work space. The data set corresponds to a single object, HSP . The function data is used to load data sets that are part of the default R distribution or that are part of an installed and, as here, loaded package. A second argument indicating a package name can also be used to load data from unloaded but installed packages (see ?data ). In Appendix A we discuss how to load data from different sources into the workspace.
R has a rich set of tools for exploring objects. Simply typing the name of an object will print out its contents. This is not practical, however, when the data set corresponding to the object is large. We can view the internal structure of the object HSP using the function str . This extremely useful function allows us to examine any object in R (see ?str for more details).
This shows that HSP is an object of class dataframe A data frame is a type of - photo 6
This shows that HSP is an object of class data.frame. A data frame is a type of list (Appendix A), a data structure that can contain nearly arbitrary components, in this case five of them. Their names are indicated after each of the $ signs. What distinguishes a data frame from a list is that each component is a vector, and all the vectors must have the same length. The entries in each vector have a class (numeric, integer, logical, Factor, etc.) indicated next to each component.
In the data set HSP , the first few elements of each component are indicated to the right of the class designation. This lets us quickly verify that data are stored in the correct format. The data set includes two components of class numeric. Q is flash intensity level measured in average number of quanta. p is the percentage of responses seen for that level. N is of class integer and indicates the number of flash presentations. Obs and Run are both factor variables encoding categorical information as integer levels. For human consumption, the levels are given labels, which are indicated in the output. The levels of Obs are the initials of the three observers, who were the three authors of the article. For two observers, data are available for a replication of the experiment, indicated by the factor Run .
Even with str , R objects with many components can be impractical to examine. In that case, it may be more convenient simply to list the names of the components, as in:
We can use this function also on the left side of an assignment operator - photo 7
We can use this function, also, on the left side of an assignment operator, <- , to modify the names of the data frame, which we will take the opportunity to do here to render the meaning of some of the components more obvious.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Modeling Psychophysical Data in R»

Look at similar books to Modeling Psychophysical Data in R. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Modeling Psychophysical Data in R»

Discussion, reviews of the book Modeling Psychophysical Data in R and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.