this is a fairly basic question, but I have spent all day trying to figure it out (including reading other questions on this page), and I could really use some help.  I am trying to run a simple mixed model with one random effect nested under a one fixed effect. In short, I have two study sites with multiple activity measurements (i.e., repeated measures) for individuals at each site. So "activity" is my response, "site" is a fixed effect factor, and "individual" is a random effects factor that is nested under site (i.e., each individual is present at only one site, but I have multiple data points for each individual). I have tried to use the following line of code, but I am not convinced that I am doing it correctly.  result &lt;- lme(activity~site+individual,data=table1,random=~1|individual/site)  Specifically, my questions are as follows:  First, do I need to specify individual both in the second term of the model and in the final term? If I am understanding correctly, the second term specifies the fixed effects, and the final term specifies the random effects, so listing "individual" in both places seems incorrect, but if I don't do that, then I do not get any output for individual.  Second, for nesting terms, my initial impression was that you always started with the higher order terms (e.g., "site/individual" would nest individual within site), but if I do that with these data, I get error messages and NaN values. So, do I list individual/site or site/individual?  Third, since the nesting term is listed as the random term, will that make the model run with both individual and site as random effects? I need to make sure that the model retains site as a fixed effect, while including individual as a random effect.  Thank you for the help   Edit: it was pointed out to me that my question may be a duplicate of a previous question (); however, that question ended up not using a nested design, thus the nesting issues that I am asking about were never resolved. Thanks again.
I just fit a model in lme4, and I'm wondering what the heck I fit...  I have individuals id, and each is measured pass/fail on items that can be described using two factors, f1 and f2. My theory says that id and f2 can interact. So I want to compare these models:  # f2 doesn't matter m1 &lt;- lmer(pass ~ f1 + (1|id), family="binomial")  # f2 is a fixed effect, doesn't interact with individuals m2 &lt;- lmer(pass ~ f1 + f2 + (1|id), family="binomial")  # f2 is a nested random effect, interacting with individuals m3 &lt;- lmer(pass ~ f1 + (1|f2/id), family="binomial")   First, am I right that there's a random effect of each level of f2, and each individual's level of f2 is partially pooled, depending on the number of observations for that individual?  Second, does it make sense to fit f2 as a fixed effect with random individuals nested within each level of f2? How does one write that?  Third, what's this, with f2 and id reversed in the formula? I typed it by accident, but now I want to understand it.  m3weird &lt;- lmer(pass ~ f1 + (1|id/f2), family="binomial")
Can I use mirroring to make a copy of my Database? How to check a particular directory is mounted on the Linux machine. For instance there is a folder named test, I want to check if it is mounted or not. How to use early stopping properly for training deep neural network? Why $e^x$ is always greater than $x^e$? I find it very strange that $$ e^x \geq x^e \, \quad \forall x \in \mathbb{R}^+.$$   I have scratched my head for a long time, but could not find any logical reason. Can anybody explain what is the reason behind the above inequality? I know this is math community, but I'd appreciate a more intuitive explanation than a technical one. It was soft and covered in flies. My guess is fungi.  Location: South Florida. How to resolve ambiguous column names when retrieving results? I have two tables in my database:  NEWS table with columns:   id - the news id  user - the user id of the author)   USERS table with columns:   id - the user id   I want to execute this SQL:   SELECT * FROM news JOIN users ON news.user = user.id    When I get the results in PHP I would like to get associative array and get column names by $row['column-name']. How do I get the news ID and the user ID, having the same column name? Getting all files that have been modified on a specific date Is it possible to find all php files within a certain directory that have been modified on a certain date  I'm using   find /var/www/html/dir/ -mtime -28 | grep '\.php'    to get files modified within the last 28 days, but I only need files that have been modified on the following date: 2011-02-08 Metric is continuous, on the right track? Let $X$ be a metric space with metric $d$. Show that $d:X\times X\rightarrow \mathbb{R}$ is continuous.   The problem is taken from Munkres Topology second edition, Section 20.  I know that if $d$ is a metric on $X$ then $d:X\times X\rightarrow \mathbb{R}$. My thinking is that the topology that is on $X$ is the topology induced by the metric $d$, and that the topology on $X\times X$ is the product topology on that space where we take the basis to be $$\mathcal{B}=\{ U \times V \mid \text{ $U,V$ both open in $X$}\}.$$ Am I on the right track to say that we define some new metric on $X\times X$ and show that this metric induces the same topology as the product topology and then work with the function $d$ as a function between metric spaces to show continuity? The question doesn't mention anything about defining some new metric and I've tried to solve the problem by looking at $X\times X$ as having the product topology, but in picking some point $(x,y) \in X\times X$ and some neighborhood around $d(x,y)$ in $\mathbb{R}$, I haven't yet found the way to make a neighborhood around $(x,y)$ which maps into the neighborhood around $d(x,y)$. RSA is not designed to be used on long blocks of plaintext like a block cipher, but I need to use it to send a large (encrypted) message.  How can I do this? Background: I am currently employed by a start-up that, so far, is doing really well. As part of my contract, I have stock options that will come available on a typical vesting schedule. A quarter of my options are set to vest later this year. Also, the company is not public yet, and it may be several years before it is public / I could sell my shares of the company.  My question is, is there any reason I should exercise them as soon as they vest? As far as I know they don't expire as long as I work at my company (if I leave for any reason, then I only have 3 months to exercise).  I don't foresee leaving any-time soon, and if I did, I would have 3 months to make a final decision.  Is there any disadvantage to just letting the option stay an option for a while? Is the Moonbeam spell amazing, or are we doing it wrong? The description of the moonbeam spell (PHB pg. 261) says:  When a creature enters the spell's area for the first time on a turn or starts its turn there, it is engulfed in ghostly flames that cause searing pain... On each of your turns after you cast this spell, you can use an action to move the beam 60 feet in any direction.  We read this to mean a creature takes damage from moonbeam when any of the following conditions are met:  It begins its turn inside the moonbeam It enters the moonbeam on its turn The creature finds itself inside the beam on another character's turn, no matter how it got there  The creature will not take damage in the following instances:  A creature moves from one part of the beam to another (obviously it had to take damage, but it won't take more damage) A creature is in the beam after having been inside the beam already on that turn.  Following these assumptions, our druid cast a moonbeam and did damage to two enemies, Bob and Frank. On their turn, they took damage again, killing Bob. Frank left the beam. On the druid's next turn, she moved the beam in a circular motion, not exceeding 60 total feet of movement, and in the process the beam came in contact with a dozen enemies and ended on Frank. All dozen enemies received damage, as they were inside the beam at some point during the turn. On Frank's next turn, he again took damage for the fourth time and died. On each of the druid's turns, she moved the moonbeam around like this until the fight ended (it did not exceed the time limit and she made all concentration checks). Is this a legitimate use of moonbeam? It seems awfully powerful for a level 2 spell. I have the following code:  Using cmd As SqlCommand = Connection.CreateCommand     cmd.CommandText = "UPDATE someTable SET Value = @Value"     cmd.CommandText &amp;= " WHERE Id = @Id"     cmd.Parameters.AddWithValue("@Id", 1234)     cmd.Parameters.AddWithValue("@Value", "myValue")     cmd.ExecuteNonQuery End Using   I wonder if there is any way to get the final SQL statment as a String, which should look like this:  UPDATE someTable SET Value = "myValue" WHERE Id = 1234   If anyone wonders why I would do this:   for logging (failed) statements for having the possibility to copy &amp; paste it to the Enterprise Manager for testing purposes Changing precision on a column in the attribute table without losing data? I have data in an Excel file that I want to join with a shapefile in my project. The Excel file contains values like volumes. The Excel file and the shapefile I want to join it with both contain the same property names.  The problem is, when I join the two, I get too many decimals in the attribute table. I get six, but I only want it to be one.  I tested to change the format of the cells to one decimal, and then I saved the file as *csv. But, somehow I seem to loose data in the process? It should be 42 rows that contains data in the column i am working with, but I end up with only like 10?  Another thing is that my property names contains the letters Å. Ä and Ö, perhaps this complicates things?  I read the question , but it doesn't mention the problem with the data loss.  My question was tagged with , but I didn't write what version I'm using. I use QGIS 2.2.0. Would it help to upgrade to the latest version? How to execute sudo commands with Expect & send commands in bash script? When to use "If I was" vs. "If I were"? Why do we call a 1/2 spin particle satisfying the Dirac equation a , and not a  or a ? Creating the Nabla operator (also known as Del operator) as an operator What is the difference between would and will in the following examples?        How would you use this word in a sentence?     How will you use this word in a sentence? Capture characters from standard input without waiting for enter to be pressed I have a weird port forwarding problem. I tried to open my port 22 to the outside network. I was able to access it as long as I am not inside the LAN. I can access it from my office for example. But from within the LAN, I can access the port using the local ip, but I can't access the port using the external IP. It's as if the router is blocking the loopback. I've check all my router settings, turned off anything firewall/filtering related. Any ideas?